aboutsummaryrefslogtreecommitdiff
path: root/gcc/gansidecl.h
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1998-04-06 12:03:16 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1998-04-06 12:03:16 +0000
commit3286ab57366ae3422fdacff3c2e605ea81a29c44 (patch)
tree41648733bb08f0139c0ad96d79953b1e77d616ff /gcc/gansidecl.h
parentd276f2bb0c9b6e5d73ff879433f8a3616ff08373 (diff)
downloadgcc-3286ab57366ae3422fdacff3c2e605ea81a29c44.zip
gcc-3286ab57366ae3422fdacff3c2e605ea81a29c44.tar.gz
gcc-3286ab57366ae3422fdacff3c2e605ea81a29c44.tar.bz2
gansidecl.h: Check if compiler supports __attribute__.
* gansidecl.h: Check if compiler supports __attribute__. Provide definitions for ATTRIBUTE_UNUSED and ATTRIBUTE_PRINTF using __attribute__ when its available. Also provide definitions for ATTRIBUTE_PRINTF_1, ATTRIBUTE_PRINTF_2 and ATTRIBUTE_PRINTF_3 in terms of ATTRIBUTE_PRINTF. * genoutput.c (process_template): Use ATTRIBUTE_UNUSED in place of __attribute__. From-SVN: r19019
Diffstat (limited to 'gcc/gansidecl.h')
-rw-r--r--gcc/gansidecl.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/gansidecl.h b/gcc/gansidecl.h
index 09a369a..68cf7b2 100644
--- a/gcc/gansidecl.h
+++ b/gcc/gansidecl.h
@@ -46,6 +46,21 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+# define __attribute__(x)
+#endif
+
+#ifndef ATTRIBUTE_UNUSED
+#define ATTRIBUTE_UNUSED __attribute__ ((unused))
+#endif /* ATTRIBUTE_UNUSED */
+
+#ifndef ATTRIBUTE_PRINTF
+#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((format (__printf__, m, n)))
+#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
+#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
+#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
+#endif /* ATTRIBUTE_PRINTF */
+
/* Define a generic NULL if one hasn't already been defined. */
#ifndef NULL