summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-10 13:02:41 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-10 13:02:41 +0000
commit0a231482f03715ed95ed4fa3d9d8380557054129 (patch)
tree310d1d76de40ddae5138d2494f3d456112cfa3b0 /include
parent90bf951c3323eff01d10330d8d65f91e04803cd9 (diff)
downloadppe42-gcc-0a231482f03715ed95ed4fa3d9d8380557054129.tar.gz
ppe42-gcc-0a231482f03715ed95ed4fa3d9d8380557054129.zip
include:
* ansidecl.h (HAVE_GCC_VERSION): New macro. Use instead of explicitly testing __GNUC__ and __GNUC_MINOR__. (ATTRIBUTE_PRINTF): Use `__format__', not `format'. gcc: * cppinit.c: Use HAVE_GCC_VERSION instead of explicitly testing __GNUC__ and __GNUC_MINOR__. * gansidecl.h: Likewise. * rtl.c: Likewise. * rtl.h: Likewise. * toplev.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * varray.c: Likewise. * varray.h: Likewise. cp: * cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing __GNUC__ and __GNUC_MINOR__. f: * proj.h: Use HAVE_GCC_VERSION instead of explicitly testing __GNUC__ and __GNUC_MINOR__. Don't define BUILT_WITH_270. Define macro UNUSED in terms of ATTRIBUTE_UNUSED. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29890 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog7
-rw-r--r--include/ansidecl.h13
2 files changed, 17 insertions, 3 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index c9e21cea5e2..48f548ed62c 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,10 @@
+1999-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * ansidecl.h (HAVE_GCC_VERSION): New macro. Use it instead of
+ explicitly testing __GNUC__ and __GNUC_MINOR__.
+
+ (ATTRIBUTE_PRINTF): Use `__format__', not `format'.
+
1999-09-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libiberty.h (make_temp_file): Add a prototype.
diff --git a/include/ansidecl.h b/include/ansidecl.h
index 989dd6778dd..8fe3893767f 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -160,16 +160,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif /* ANSI C. */
+/* This macro will return true if we are using gcc, and it is of a
+ particular minimum version (both major & minor numbers are checked.) */
+#ifndef HAVE_GCC_VERSION
+#define HAVE_GCC_VERSION(MAJOR, MINOR) \
+ (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
+#endif /* ! HAVE_GCC_VERSION */
+
/* Define macros for some gcc attributes. This permits us to use the
macros freely, and know that they will come into play for the
version of gcc in which they are supported. */
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+#if ! HAVE_GCC_VERSION(2,7)
# define __attribute__(x)
#endif
#ifndef ATTRIBUTE_UNUSED_LABEL
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 93)
+# if ! HAVE_GCC_VERSION(2,93)
# define ATTRIBUTE_UNUSED_LABEL
# else
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
@@ -185,7 +192,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif /* ATTRIBUTE_NORETURN */
#ifndef ATTRIBUTE_PRINTF
-#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((format (__printf__, m, n)))
+#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)
OpenPOWER on IntegriCloud