|
|
6693b3 |
2004-10-18 Jakub Jelinek <jakub@redhat.com>
|
|
|
6693b3 |
|
|
|
6693b3 |
* c-cppbuiltin.c (define__GNUC__): Also define __GNUC_RH_RELEASE__.
|
|
|
6693b3 |
|
|
|
6693b3 |
--- gcc/c-cppbuiltin.c.jj 2004-03-08 18:48:58.000000000 +0100
|
|
|
6693b3 |
+++ gcc/c-cppbuiltin.c 2004-10-18 16:40:14.450009521 +0200
|
|
|
6693b3 |
@@ -254,14 +254,14 @@ define__GNUC__ (void)
|
|
|
6693b3 |
{
|
|
|
6693b3 |
/* The format of the version string, enforced below, is
|
|
|
6693b3 |
([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)? */
|
|
|
6693b3 |
- const char *q, *v = version_string;
|
|
|
6693b3 |
+ const char *q, *v = version_string, *vstart, *vend;
|
|
|
6693b3 |
|
|
|
6693b3 |
while (*v && ! ISDIGIT (*v))
|
|
|
6693b3 |
v++;
|
|
|
6693b3 |
if (!*v || (v > version_string && v[-1] != '-'))
|
|
|
6693b3 |
abort ();
|
|
|
6693b3 |
|
|
|
6693b3 |
- q = v;
|
|
|
6693b3 |
+ vstart = q = v;
|
|
|
6693b3 |
while (ISDIGIT (*v))
|
|
|
6693b3 |
v++;
|
|
|
6693b3 |
builtin_define_with_value_n ("__GNUC__", q, v - q);
|
|
|
6693b3 |
@@ -289,6 +289,30 @@ define__GNUC__ (void)
|
|
|
6693b3 |
|
|
|
6693b3 |
if (*v && *v != ' ' && *v != '-')
|
|
|
6693b3 |
abort ();
|
|
|
6693b3 |
+
|
|
|
6693b3 |
+ vend = v;
|
|
|
6693b3 |
+ v = strchr (v, '(');
|
|
|
6693b3 |
+ if (v != NULL && strncmp (v + 1, "Red Hat ", 8) == 0)
|
|
|
6693b3 |
+ {
|
|
|
6693b3 |
+ v += 9;
|
|
|
6693b3 |
+ if (strncmp (v, "Linux ", 6) == 0)
|
|
|
6693b3 |
+ v += 6;
|
|
|
6693b3 |
+
|
|
|
6693b3 |
+ if (strncmp (v, vstart, vend - vstart) != 0
|
|
|
6693b3 |
+ || v[vend - vstart] != '-')
|
|
|
6693b3 |
+ abort ();
|
|
|
6693b3 |
+
|
|
|
6693b3 |
+ v += vend - vstart + 1;
|
|
|
6693b3 |
+ q = v;
|
|
|
6693b3 |
+ if (!ISDIGIT (*v))
|
|
|
6693b3 |
+ abort ();
|
|
|
6693b3 |
+ while (ISDIGIT (*v))
|
|
|
6693b3 |
+ v++;
|
|
|
6693b3 |
+ builtin_define_with_value_n ("__GNUC_RH_RELEASE__", q, v - q);
|
|
|
6693b3 |
+
|
|
|
6693b3 |
+ if (*v && *v != ')' && *v != '.')
|
|
|
6693b3 |
+ abort ();
|
|
|
6693b3 |
+ }
|
|
|
6693b3 |
}
|
|
|
6693b3 |
|
|
|
6693b3 |
/* Hook that registers front end and target-specific built-ins. */
|