]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Do not define __attribute__ in header files.
authorMiguel Ángel Arruga Vivas <rosen644835@gmail.com>
Wed, 6 Mar 2013 20:11:19 +0000 (21:11 +0100)
committerMiguel Ángel Arruga Vivas <rosen644835@gmail.com>
Thu, 7 Mar 2013 09:26:49 +0000 (10:26 +0100)
Fix Savannah bug #35313.

gettext-runtime/libasprintf/ChangeLog
gettext-runtime/libasprintf/autosprintf.in.h

index 14ae717985c87a84ba98fd3f568dfbf6980e2ee0..d0f706ddefadb64decfc9d71bf7fa7b990d75a82 100644 (file)
@@ -1,3 +1,10 @@
+2013-03-07  Miguel Angel Arruga Vivas  <rosen644835@gmail.com>  (tiny change)
+
+       Fix '__attribute__' definition.
+       Reported at <https://savannah.gnu.org/bugs/?35313>
+       * autosprintf.in.h (_AUTOSPRINTF_ATTRIBUTE_FORMAT): New macro
+       instead of redefine __attribute__.
+
 2013-03-04  Miguel Angel Arruga Vivas  <rosen644835@gmail.com>  (tiny change)
 
        Add 'autosprintf::operator='. Needed because destructor
index 1efd15a3d781cade66ebe98527506712c5d0d63e..784af918569797516e38056e31e36aeb7bbf6bf9 100644 (file)
 #ifndef _AUTOSPRINTF_H
 #define _AUTOSPRINTF_H
 
-#ifndef __attribute__
 /* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
-#  define __attribute__(Spec) /* empty */
-# endif
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+# define _AUTOSPRINTF_ATTRIBUTE_FORMAT() /* empty */
+#else
 /* The __-protected variants of 'format' and 'printf' attributes
    are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-#  define __format__ format
-#  define __printf__ printf
+#  define _AUTOSPRINTF_ATTRIBUTE_FORMAT() \
+  __attribute__ ((__format__ (__printf__, 2, 3)))
+# else
+#  define _AUTOSPRINTF_ATTRIBUTE_FORMAT() \
+  __attribute__ ((format (printf, 2, 3)))
 # endif
 #endif
 
@@ -42,7 +44,7 @@ namespace gnu
   public:
     /* Constructor: takes a format string and the printf arguments.  */
     autosprintf (const char *format, ...)
-                __attribute__ ((__format__ (__printf__, 2, 3)));
+                _AUTOSPRINTF_ATTRIBUTE_FORMAT();
     /* Copy constructor.  */
     autosprintf (const autosprintf& src);
     autosprintf& operator = (autosprintf copy);