ansidecl.h: Define and test `GCC_VERSION', not `HAVE_GCC_VERSION'.
authorPhilippe De Muyter <phdm@macqel.be>
Wed, 10 Nov 1999 17:57:21 +0000 (18:57 +0100)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Wed, 10 Nov 1999 17:57:21 +0000 (17:57 +0000)
include:
        * ansidecl.h: Define and test `GCC_VERSION', not `HAVE_GCC_VERSION'.

gcc:
        * cppinit.c: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.

        * gansidecl.h: Likewise.

        * rtl.c: Likewise.

        * rtl.h: Likewise.

        * toplev.h: Likewise.

        * tree.c: Likewise.

        * tree.h: Likewise.

        * varray.c: Likewise.

        * varray.h: Likewise.

gcc/cp:
        * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.

gcc/f:
        * proj.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.

Co-Authored-By: Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
From-SVN: r30477

16 files changed:
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cppinit.c
gcc/f/ChangeLog
gcc/f/proj.h
gcc/gansidecl.h
gcc/rtl.c
gcc/rtl.h
gcc/toplev.h
gcc/tree.c
gcc/tree.h
gcc/varray.c
gcc/varray.h
include/ChangeLog
include/ansidecl.h

index b72b02ea978b0bffdd6bb70c42c10393fb52414e..6949bb68598f09c5322313ca4778b4beeef773ea 100644 (file)
@@ -1,3 +1,24 @@
+Wed Nov 10 12:43:21 1999  Philippe De Muyter  <phdm@macqel.be>
+                          Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * cppinit.c: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.
+
+       * gansidecl.h: Likewise.
+
+       * rtl.c: Likewise.
+
+       * rtl.h: Likewise.
+
+       * toplev.h: Likewise.
+
+       * tree.c: Likewise.
+
+       * tree.h: Likewise.
+
+       * varray.c: Likewise.
+
+       * varray.h: Likewise.
+
 Wed Nov 10 10:57:22 1999  Clinton Popetz  <cpopetz@cygnus.com>
 
        * gcov.c (struct arcdata): Add hits and total, remove prob.
index e1b34f82f1739a7b0c095678c36357b7b7474d42..0f4e3f5faf6dd41d07fb381fa1016462d81bd942 100644 (file)
@@ -1,3 +1,8 @@
+Wed Nov 10 12:43:21 1999  Philippe De Muyter  <phdm@macqel.be>
+                          Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.
+
 1999-11-09  Mark Mitchell  <mark@codesourcery.com>
 
        * cp-tree.h (language_function): Remove x_last_dtor_insn and
index eba8e026ace880d58c98d5fcc8b3499fd0352a7b..f4059a25ec839a9eb3cea5d9e5da06258efeede0 100644 (file)
@@ -124,7 +124,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* Language-specific tree checkers. */
 
-#if defined ENABLE_CHECKING && HAVE_GCC_VERSION(2,7)
+#if defined ENABLE_CHECKING && (GCC_VERSION >= 2007)
 
 #define VAR_OR_FUNCTION_DECL_CHECK(NODE)                       \
 ({  const tree __t = NODE;                                     \
index fa41c3ca74bee004deeb6ef89a3abefaa41094f8..691e1b0d4c408053086ec8a916b1ae23f0f5b0ab 100644 (file)
@@ -216,7 +216,7 @@ enum { QUOTE = 0, BRACKET, SYSTEM, AFTER };
 #define CAT(a, b) a/**/b
 #endif
 
-#if HAVE_GCC_VERSION(2,7)
+#if (GCC_VERSION >= 2007)
 #define TABLE(id) static inline void CAT(init_, id) PARAMS ((void)) {} \
 unsigned char id[256] = {
 #define s(p, v) [p] = v,
index f676c45546a166134175268979cf5343b424957f..258affeb18d9d8a8cb00e20b547f08971fcbaca8 100644 (file)
@@ -1,3 +1,8 @@
+Wed Nov 10 12:43:21 1999  Philippe De Muyter  <phdm@macqel.be>
+                          Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * proj.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.
+
 Tue Oct 26 01:32:19 1999  Mark Mitchell  <mark@codesourcery.com>
 
        * com.c (poplevel): Don't call remember_end_note.
index 96bb44af27c9a75c8c72fcf857c8b53cb80f25a4..d55bd88f8a61cd097350acfb310dfcffbd6023c5 100644 (file)
@@ -31,7 +31,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #endif
 #include "system.j"
 
-#if ! HAVE_GCC_VERSION(2,0)
+#if (GCC_VERSION < 2000)
 #error "You have to use gcc 2.x to build g77 (might be fixed in g77-0.6)."
 #endif
 
index 17a7c919b632711fedc47b21bd2686aa729cc846..ae88cca55424ba9d9cd0bbc2d5e5f53637b9fc9e 100644 (file)
@@ -41,7 +41,7 @@ Boston, MA 02111-1307, USA.  */
    need to do this very early; i.e. before any systems header files or
    gcc header files in case they use these keywords.  Otherwise
    conflicts might occur. */
-#if HAVE_GCC_VERSION(2,7)
+#if (GCC_VERSION >= 2007)
 # undef const
 # undef inline
 # define inline __inline__  /* Modern gcc can use `__inline__' freely. */
index 80b791d295332624a3fe9a6703aafa784b92581a..77800e3a501fdced0b1e37aff5de2e356369e9ac 100644 (file)
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -1128,7 +1128,7 @@ read_rtx (infile)
   return return_rtx;
 }
 
-#if defined ENABLE_CHECKING && HAVE_GCC_VERSION(2,7)
+#if defined ENABLE_CHECKING && (GCC_VERSION >= 2007)
 void
 rtl_check_failed_bounds (r, n, file, line, func)
     rtx r;
index baa4d83bdde268bb8e2f0f7c7fec951a347a8500..bcf0278e0f5627a9e2bf2f44273ca3353c146cc6 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -226,7 +226,7 @@ typedef struct rtvec_def{
 
 /* General accessor macros for accessing the fields of an rtx.  */
 
-#if defined ENABLE_CHECKING  && HAVE_GCC_VERSION(2,7)
+#if defined ENABLE_CHECKING && (GCC_VERSION >= 2007)
 /* The bit with a star outside the statement expr and an & inside is
    so that N can be evaluated only once.  */
 #define RTL_CHECK1(RTX, N, C1)                                         \
@@ -1679,10 +1679,10 @@ extern int read_rtx_lineno;
 
 extern void fancy_abort PROTO((const char *, int, const char *))
     ATTRIBUTE_NORETURN;
-#if ! HAVE_GCC_VERSION(2,7)
-#define abort() fancy_abort (__FILE__, __LINE__, 0)
-#else
+#if (GCC_VERSION >= 2007)
 #define abort() fancy_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
+#else
+#define abort() fancy_abort (__FILE__, __LINE__, 0)
 #endif
 
 /* In alias.c */
index f0d1b6136480e25c7033f3e96ec90e6a52a878c8..71654577dcee3ae0efe2042462be09d55db686c4 100644 (file)
@@ -51,7 +51,7 @@ extern void _fatal_insn                       PROTO ((const char *,
                                                const char *))
   ATTRIBUTE_NORETURN;
 
-#if HAVE_GCC_VERSION(2,7)
+#if (GCC_VERSION >= 2007)
 #define fatal_insn(msgid, insn) \
        _fatal_insn (msgid, insn, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 #define fatal_insn_not_found(insn) \
index c3a95a6f85a1649909a584f04e729e3dffa65ad7..ea5c1bfce767ee2f3c802cdb8770eadecda997fe 100644 (file)
@@ -5136,7 +5136,7 @@ get_set_constructor_bytes (init, buffer, wd_size)
   return non_const_bits;
 }
 \f
-#if defined ENABLE_CHECKING && HAVE_GCC_VERSION(2,7)
+#if defined ENABLE_CHECKING && (GCC_VERSION >= 2007)
 /* Complain that the tree code of NODE does not match the expected CODE.
    FILE, LINE, and FUNCTION are of the caller.  */
 void
index 4af3a1ddb675d767c89dd9ad4de52d6aa656cd4c..42760c868efa400abf50c040d83db1229eff616d 100644 (file)
@@ -321,7 +321,7 @@ struct tree_common
 
 /* When checking is enabled, errors will be generated if a tree node
    is accessed incorrectly. The macros abort with a fatal error.  */
-#if defined ENABLE_CHECKING && HAVE_GCC_VERSION(2,7)
+#if defined ENABLE_CHECKING && (GCC_VERSION >= 2007)
 
 #define TREE_CHECK(t, code)                                            \
 ({  const tree __t = t;                                                        \
@@ -2513,8 +2513,8 @@ extern void dwarf2out_end_epilogue        PROTO((void));
 
 extern void fancy_abort PROTO((const char *, int, const char *))
     ATTRIBUTE_NORETURN;
-#if ! HAVE_GCC_VERSION(2,7)
-#define abort() fancy_abort (__FILE__, __LINE__, 0)
-#else
+#if (GCC_VERSION >= 2007)
 #define abort() fancy_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
+#else
+#define abort() fancy_abort (__FILE__, __LINE__, 0)
 #endif
index 95752c4e5310b0afe5d4e654ec3cfc425558e013..34ce80b284bfd6fac6b704274210331321c1bfd7 100644 (file)
@@ -71,7 +71,7 @@ varray_grow (va, n)
 
 /* Check the bounds of a varray access.  */
 
-#if defined ENABLE_CHECKING && HAVE_GCC_VERSION(2,7)
+#if defined ENABLE_CHECKING && (GCC_VERSION >= 2007)
 
 extern void error PVPROTO ((const char *, ...))        ATTRIBUTE_PRINTF_1;
 
index b826b63d6c664db8d50b088cd8fe8928b4c6ff83..51be0146bce2ce451eff333be0b86586547aefbf 100644 (file)
@@ -163,7 +163,7 @@ extern varray_type varray_grow      PROTO((varray_type, size_t));
 #define VARRAY_SIZE(VA)        ((VA)->num_elements)
 
 /* Check for VARRAY_xxx macros being in bound.  */
-#if defined ENABLE_CHECKING && HAVE_GCC_VERSION(2,7)
+#if defined ENABLE_CHECKING && (GCC_VERSION >= 2007)
 extern void varray_check_failed PROTO ((varray_type, size_t,
                                        const char *, int,
                                        const char *)) ATTRIBUTE_NORETURN;
index 545574f9f27ee6dc6fd6e6b7280f2336b021767a..5bdc29052f39a7220798620159885ef2373f0178 100644 (file)
@@ -1,3 +1,8 @@
+Wed Nov 10 12:43:21 1999  Philippe De Muyter  <phdm@macqel.be>
+                          Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * ansidecl.h: Define and test `GCC_VERSION', not `HAVE_GCC_VERSION'.
+       
 1999-10-23 08:51 -0700  Zack Weinberg  <zack@bitmover.com>
 
        * hashtab.h: Give hash_table_t a struct tag.  Add prototypes
index 8fe3893767fe39c72cb03b4b77714da4d42aa90d..2b5c0e7f549bc62f71e74ab9409e1c15b5e99292 100644 (file)
@@ -160,27 +160,40 @@ 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
+
+/* Using MACRO(x,y) in cpp #if conditionals does not work with some
+   older preprocessors.  Thus we can't define something like this:
+
 #define HAVE_GCC_VERSION(MAJOR, MINOR) \
   (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
-#endif /* ! HAVE_GCC_VERSION */
+
+and then test "#if HAVE_GCC_VERSION(2,7)".
+
+So instead we use the macro below and test it against specific values.  */
+
+/* This macro simplifies testing whether we are using gcc, and if it
+   is of a particular minimum version. (Both major & minor numbers are
+   significant.)  This macro will evaluate to 0 if we are not using
+   gcc at all.  */
+#ifndef GCC_VERSION
+#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+#endif /* 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 ! HAVE_GCC_VERSION(2,7)
+#if (GCC_VERSION < 2007)
 # define __attribute__(x)
 #endif
 
+/* Attributes on labels were valid as of gcc 2.93. */
 #ifndef ATTRIBUTE_UNUSED_LABEL
-# if ! HAVE_GCC_VERSION(2,93)
-#  define ATTRIBUTE_UNUSED_LABEL
-# else
+# if (GCC_VERSION >= 2093)
 #  define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
-# endif /* GNUC < 2.93 */
+# else
+#  define ATTRIBUTE_UNUSED_LABEL
+# endif /* GNUC >= 2.93 */
 #endif /* ATTRIBUTE_UNUSED_LABEL */
 
 #ifndef ATTRIBUTE_UNUSED