From ddc534916dc2a156141f490d1b744715d4cff9b8 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Thu, 18 Feb 2010 14:28:38 +0000 Subject: [PATCH] Allow the pmap code to be built with GCC from FreeBSD 7 again. This patch basically gives us the best of both worlds. Instead of forcing the compiler to emulate GNU-style inline semantics even though we're using ISO C99, it will only use GNU-style inlining when the compiler is configured that way (__GNUC_GNU_INLINE__). Tested by: jhb --- sys/amd64/amd64/pmap.c | 4 ++++ sys/i386/i386/pmap.c | 4 ++++ sys/i386/xen/pmap.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 9bc1f8c3d69a..bbb50a80c3d3 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -151,7 +151,11 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(DIAGNOSTIC) +#ifdef __GNUC_GNU_INLINE__ +#define PMAP_INLINE inline +#else #define PMAP_INLINE extern inline +#endif #else #define PMAP_INLINE #endif diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index bd3376c64a40..72913064e01b 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -162,7 +162,11 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(DIAGNOSTIC) +#ifdef __GNUC_GNU_INLINE__ +#define PMAP_INLINE inline +#else #define PMAP_INLINE extern inline +#endif #else #define PMAP_INLINE #endif diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c index 35f006de3e32..cec16636e91e 100644 --- a/sys/i386/xen/pmap.c +++ b/sys/i386/xen/pmap.c @@ -173,7 +173,11 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(PMAP_DIAGNOSTIC) +#ifdef __GNUC_GNU_INLINE__ +#define PMAP_INLINE inline +#else #define PMAP_INLINE extern inline +#endif #else #define PMAP_INLINE #endif