httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r758627 - in /httpd/httpd/trunk/modules/filters: mod_ratelimit.c mod_ratelimit.h
Date Thu, 26 Mar 2009 13:26:42 GMT
Author: wrowe
Date: Thu Mar 26 13:26:38 2009
New Revision: 758627

URL: http://svn.apache.org/viewvc?rev=758627&view=rev
Log:
Namespaces namespaces namespaces guys... EFAIL :)

Modified:
    httpd/httpd/trunk/modules/filters/mod_ratelimit.c
    httpd/httpd/trunk/modules/filters/mod_ratelimit.h

Modified: httpd/httpd/trunk/modules/filters/mod_ratelimit.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_ratelimit.c?rev=758627&r1=758626&r2=758627&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_ratelimit.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_ratelimit.c Thu Mar 26 13:26:38 2009
@@ -123,7 +123,7 @@
             /* 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 @@
         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 @@
     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 @@
     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 @@
     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_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,

Modified: httpd/httpd/trunk/modules/filters/mod_ratelimit.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_ratelimit.h?rev=758627&r1=758626&r2=758627&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_ratelimit.h (original)
+++ httpd/httpd/trunk/modules/filters/mod_ratelimit.h Thu Mar 26 13:26:38 2009
@@ -17,14 +17,35 @@
 #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



Mime
View raw message