diff options
author | jdp <jdp@FreeBSD.org> | 1998-10-29 04:27:06 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1998-10-29 04:27:06 +0000 |
commit | 5eec3e3f2074ea1ff7dcec732bdc7db338e6d941 (patch) | |
tree | ebd1fa3664c01a53fa11f6fb477f6417aab06795 /contrib/gcc | |
parent | 5f6ddf9a479628c018b05d33e6bebb073c6f85cd (diff) | |
download | FreeBSD-src-5eec3e3f2074ea1ff7dcec732bdc7db338e6d941.zip FreeBSD-src-5eec3e3f2074ea1ff7dcec732bdc7db338e6d941.tar.gz |
Add a new predefined preprocessor symbol "__FreeBSD_cc_version",
with a numeric value that describes the feature level of the
compiler. This can be used to check for the presence/absence of
FreeBSD-specific compiler features. The value is a decimal number
whose digits have the form VRRRRFF, where:
V = Compiler vendor. 0 (elided) means gcc.
RRRR = Vendor's version number, e.g., 2721 for the current
gcc version (2.7.2.1).
FF = FreeBSD-specific revision level. 00 means the stock
compiler from the vendor.
The value of "__FreeBSD_cc_version" is hard-coded in
"src/contrib/gcc/config/i386/freebsd.h" and must be incremented
when new FreeBSD-specific compiler features are added. I considered
simply picking up the value of FreeBSD_version from <osreldate.h>.
But that would break cross compiles of gcc.
PR: Part of the fix for gnu/8452
Suggested by: bde
Diffstat (limited to 'contrib/gcc')
-rw-r--r-- | contrib/gcc/config/i386/freebsd.h | 2 | ||||
-rw-r--r-- | contrib/gcc/config/i386/freebsd.h.fixed | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/contrib/gcc/config/i386/freebsd.h b/contrib/gcc/config/i386/freebsd.h index d55c8f8..3391f37 100644 --- a/contrib/gcc/config/i386/freebsd.h +++ b/contrib/gcc/config/i386/freebsd.h @@ -477,7 +477,7 @@ do { \ #endif /* FREEBSD_NATIVE */ #undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=3 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" +#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=3 -D__FreeBSD_cc_version=272101 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" #undef CPP_SPEC #if TARGET_CPU_DEFAULT == 2 diff --git a/contrib/gcc/config/i386/freebsd.h.fixed b/contrib/gcc/config/i386/freebsd.h.fixed index d55c8f8..3391f37 100644 --- a/contrib/gcc/config/i386/freebsd.h.fixed +++ b/contrib/gcc/config/i386/freebsd.h.fixed @@ -477,7 +477,7 @@ do { \ #endif /* FREEBSD_NATIVE */ #undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=3 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" +#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=3 -D__FreeBSD_cc_version=272101 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" #undef CPP_SPEC #if TARGET_CPU_DEFAULT == 2 |