]> granicus.if.org Git - apache/commitdiff
Namespaces namespaces namespaces guys... EFAIL :)
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 26 Mar 2009 13:26:38 +0000 (13:26 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 26 Mar 2009 13:26:38 +0000 (13:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758627 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_ratelimit.c
modules/filters/mod_ratelimit.h

index 1b2e4ff5d62cf5ba1c5fd8fd85679736884fc439..c1789535a16421e99027b8d751ad78f3376f0f91 100644 (file)
@@ -123,7 +123,7 @@ rate_limit_filter(ap_filter_t *f, apr_bucket_brigade *input_bb)
             /* Find where we 'stop' going full speed. */
             for (e = APR_BRIGADE_FIRST(bb);
                  e != APR_BRIGADE_SENTINEL(bb); e = APR_BUCKET_NEXT(e)) {
-                if (RL_BUCKET_IS_END(e)) {
+                if (AP_RL_BUCKET_IS_END(e)) {
                     apr_bucket *f;
                     f = APR_RING_LAST(&bb->list);
                     APR_RING_UNSPLICE(e, f, link);
@@ -154,7 +154,7 @@ rate_limit_filter(ap_filter_t *f, apr_bucket_brigade *input_bb)
         while (ctx->state == RATE_LIMIT && !APR_BRIGADE_EMPTY(bb)) {
             for (e = APR_BRIGADE_FIRST(bb);
                  e != APR_BRIGADE_SENTINEL(bb); e = APR_BUCKET_NEXT(e)) {
-                if (RL_BUCKET_IS_START(e)) {
+                if (AP_RL_BUCKET_IS_START(e)) {
                     apr_bucket *f;
                     f = APR_RING_LAST(&bb->list);
                     APR_RING_UNSPLICE(e, f, link);
@@ -239,8 +239,8 @@ rl_bucket_read(apr_bucket *b, const char **str,
     return APR_SUCCESS;
 }
 
-AP_DECLARE(apr_bucket *)
-    rl_end_create(apr_bucket_alloc_t *list)
+AP_RL_DECLARE(apr_bucket *)
+    ap_rl_end_create(apr_bucket_alloc_t *list)
 {
     apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
 
@@ -250,13 +250,13 @@ AP_DECLARE(apr_bucket *)
     b->length = 0;
     b->start = 0;
     b->data = NULL;
-    b->type = &rl_bucket_type_end;
+    b->type = &ap_rl_bucket_type_end;
 
     return b;
 }
 
-AP_DECLARE(apr_bucket *)
-    rl_start_create(apr_bucket_alloc_t *list)
+AP_RL_DECLARE(apr_bucket *)
+    ap_rl_start_create(apr_bucket_alloc_t *list)
 {
     apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
 
@@ -266,14 +266,14 @@ AP_DECLARE(apr_bucket *)
     b->length = 0;
     b->start = 0;
     b->data = NULL;
-    b->type = &rl_bucket_type_start;
+    b->type = &ap_rl_bucket_type_start;
 
     return b;
 }
 
 
 
-AP_DECLARE_DATA const apr_bucket_type_t rl_bucket_type_end = {
+AP_RL_DECLARE_DATA const apr_bucket_type_t ap_rl_bucket_type_end = {
     "RL_END", 5, APR_BUCKET_METADATA,
     apr_bucket_destroy_noop,
     rl_bucket_read,
@@ -283,7 +283,7 @@ AP_DECLARE_DATA const apr_bucket_type_t rl_bucket_type_end = {
 };
 
 
-AP_DECLARE_DATA const apr_bucket_type_t rl_bucket_type_start = {
+AP_RL_DECLARE_DATA const apr_bucket_type_t ap_rl_bucket_type_start = {
     "RL_START", 5, APR_BUCKET_METADATA,
     apr_bucket_destroy_noop,
     rl_bucket_read,
index c04bc4ab8ab7528b4abd8361287c0f6f462b36fe..4648326b802b68530bd1eea52b213ac6c9e0c5b2 100644 (file)
 #ifndef _MOD_RATELIMIT_H_
 #define _MOD_RATELIMIT_H_
 
-AP_DECLARE_DATA extern const apr_bucket_type_t rl_bucket_type_end;
-AP_DECLARE_DATA extern const apr_bucket_type_t rl_bucket_type_start;
+/* Create a set of AP_RL_DECLARE(type), AP_RL_DECLARE_NONSTD(type) and 
+ * AP_RL_DECLARE_DATA with appropriate export and import tags for the platform
+ */
+#if !defined(WIN32)
+#define AP_RL_DECLARE(type)            type
+#define AP_RL_DECLARE_NONSTD(type)     type
+#define AP_RL_DECLARE_DATA
+#elif defined(AP_RL_DECLARE_STATIC)
+#define AP_RL_DECLARE(type)            type __stdcall
+#define AP_RL_DECLARE_NONSTD(type)     type
+#define AP_RL_DECLARE_DATA
+#elif defined(AP_RL_DECLARE_EXPORT)
+#define AP_RL_DECLARE(type)            __declspec(dllexport) type __stdcall
+#define AP_RL_DECLARE_NONSTD(type)     __declspec(dllexport) type
+#define AP_RL_DECLARE_DATA             __declspec(dllexport)
+#else
+#define AP_RL_DECLARE(type)            __declspec(dllimport) type __stdcall
+#define AP_RL_DECLARE_NONSTD(type)     __declspec(dllimport) type
+#define AP_RL_DECLARE_DATA             __declspec(dllimport)
+#endif
+
+AP_RL_DECLARE_DATA extern const apr_bucket_type_t ap_rl_bucket_type_end;
+AP_RL_DECLARE_DATA extern const apr_bucket_type_t ap_rl_bucket_type_start;
 
-#define RL_BUCKET_IS_END(e)         (e->type == &rl_bucket_type_end)
-#define RL_BUCKET_IS_START(e)         (e->type == &rl_bucket_type_start)
+#define AP_RL_BUCKET_IS_END(e)         (e->type == &ap_rl_bucket_type_end)
+#define AP_RL_BUCKET_IS_START(e)         (e->type == &ap_rl_bucket_type_start)
 
 /* TODO: Make these Optional Functions, so that module load order doesn't matter. */
-apr_bucket* rl_end_create(apr_bucket_alloc_t *list);
-apr_bucket* rl_start_create(apr_bucket_alloc_t *list);
+AP_RL_DECLARE(apr_bucket*) ap_rl_end_create(apr_bucket_alloc_t *list);
+AP_RL_DECLARE(apr_bucket*) ap_rl_start_create(apr_bucket_alloc_t *list);
 
 #endif