]> granicus.if.org Git - apache/commitdiff
Avoid "`sentinel' attribute directive ignored" warning with gcc 3.x
authorStefan Fritsch <sf@apache.org>
Sun, 12 Jun 2011 10:40:17 +0000 (10:40 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 12 Jun 2011 10:40:17 +0000 (10:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1134906 13f79535-47bb-0310-9956-ffa450edef68

include/ap_config.h
include/http_protocol.h
include/http_request.h
include/util_cookies.h
include/util_filter.h
include/util_script.h

index 0f67c3f07fac65e9aecfe1faaba256a8d971026c..ea2c19581bcde90589673b648f11cfa3b29607db 100644 (file)
 #define AP_HAVE_DESIGNATED_INITIALIZER
 #endif
 
+#ifndef __has_attribute         /* check for supported attributes on clang */
+#define __has_attribute(x) 0
+#endif
+#if (defined(__GNUC__) && __GNUC__ >= 4) || __has_attribute(sentinel)
+#define ap_func_attr_sentinel __attribute__((sentinel))
+#else
+#define ap_func_attr_sentinel
+#endif
+
 #endif /* AP_CONFIG_H */
index 705268efe33bdbaf7817d1c3bdf0f758df81bea4..b33279bca8fef9f8c940c4728cc7175b8e08386e 100644 (file)
@@ -346,7 +346,7 @@ static inline int ap_rputs(const char *str, request_rec *r)
  * @return The number of bytes sent
  */
 AP_DECLARE_NONSTD(int) ap_rvputs(request_rec *r,...)
-                       __attribute__((sentinel));
+                       ap_func_attr_sentinel;
 
 /**
  * Output data to the client in a printf format
index e591f6ea2c9d1710e9849c5210246592baf6cd25..644079eb10854884813f45638480890a341157c4 100644 (file)
@@ -285,7 +285,7 @@ AP_DECLARE(void) ap_update_mtime(request_rec *r, apr_time_t dependency_mtime);
  * @return  None.
  */
 AP_DECLARE(void) ap_allow_methods(request_rec *r, int reset, ...)
-                 __attribute__((sentinel));
+                 ap_func_attr_sentinel;
 
 /**
  * Add one or more methods to the list permitted to access the resource.
index 439d28926d6221808e1eb79948b30631b556cb78..c424dc045d9d233d3cd5eb6470a713687b2c99db 100644 (file)
@@ -68,7 +68,7 @@ typedef struct {
 AP_DECLARE(apr_status_t) ap_cookie_write(request_rec * r, const char *name,
                                          const char *val, const char *attrs,
                                          long maxage, ...)
-                         __attribute__((sentinel));
+                         ap_func_attr_sentinel;
 
 /**
  * Write an RFC2965 compliant cookie.
@@ -85,7 +85,7 @@ AP_DECLARE(apr_status_t) ap_cookie_write(request_rec * r, const char *name,
 AP_DECLARE(apr_status_t) ap_cookie_write2(request_rec * r, const char *name2,
                                           const char *val, const char *attrs2,
                                           long maxage, ...)
-                         __attribute__((sentinel));
+                         ap_func_attr_sentinel;
 
 /**
  * Remove an RFC2109 compliant cookie.
@@ -99,7 +99,7 @@ AP_DECLARE(apr_status_t) ap_cookie_write2(request_rec * r, const char *name2,
  */
 AP_DECLARE(apr_status_t) ap_cookie_remove(request_rec * r, const char *name,
                                           const char *attrs, ...)
-                         __attribute__((sentinel));
+                         ap_func_attr_sentinel;
 
 /**
  * Remove an RFC2965 compliant cookie.
@@ -113,7 +113,7 @@ AP_DECLARE(apr_status_t) ap_cookie_remove(request_rec * r, const char *name,
  */
 AP_DECLARE(apr_status_t) ap_cookie_remove2(request_rec * r, const char *name2,
                                            const char *attrs2, ...)
-                         __attribute__((sentinel));
+                         ap_func_attr_sentinel;
 
 /**
  * Read a cookie called name, placing its value in val.
index 449889d1a6cd27d16fd0d341d942e769c620835e..5c8245d7cf38efd961a321e387150115b546faf7 100644 (file)
@@ -547,10 +547,7 @@ AP_DECLARE(apr_status_t) ap_fflush(ap_filter_t *f, apr_bucket_brigade *bb);
 AP_DECLARE_NONSTD(apr_status_t) ap_fputstrs(ap_filter_t *f,
                                             apr_bucket_brigade *bb,
                                             ...)
-#if defined(__GNUC__) && __GNUC__ >= 4
-    __attribute__((sentinel))
-#endif
-;
+                                ap_func_attr_sentinel;
 
 /**
  * Output data to the filter in printf format
index 04511c9768c4ef06bc411a9dc152bbd0045a5c72..e019aaefd80998e553a98c17e0b01bff5d7f5797 100644 (file)
@@ -27,6 +27,7 @@
 #define APACHE_UTIL_SCRIPT_H
 
 #include "apr_buckets.h"
+#include "ap_config.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -123,7 +124,7 @@ AP_DECLARE_NONSTD(int) ap_scan_script_header_err_strs(request_rec *r,
                                                       char *buffer, 
                                                       const char **termch,
                                                       int *termarg, ...)
-                       __attribute__((sentinel));
+                       ap_func_attr_sentinel;
 
 /**
  * Read headers output from a script, ensuring that the output is valid.  If