diff options
author | Ian Lance Taylor <iant@google.com> | 2009-06-01 05:47:20 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2009-06-01 05:47:20 +0000 |
commit | 75afccba060cc990398ffa0741aca68232ac6f56 (patch) | |
tree | 3b2a132932c7507b3015e25cfed307df6d200eca /include/ansidecl.h | |
parent | 6863c0f0d1b5341d517571a00f511170296fb305 (diff) | |
download | gcc-75afccba060cc990398ffa0741aca68232ac6f56.tar.gz |
ansidecl.h: Add extern "C" when compiling with C++.
* ansidecl.h: Add extern "C" when compiling with C++. Treat C++
the way we treat an ISO C compiler. Don't define inline as a
macdro when compiling with C++.
* dyn-string.h: Add header guard DYN_STRING_H. Add extern "C"
when compiling with C++.
* fibheap.h: Add extern "C" when compiling with C++.
From-SVN: r148032
Diffstat (limited to 'include/ansidecl.h')
-rw-r--r-- | include/ansidecl.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/ansidecl.h b/include/ansidecl.h index c19955a98a6..c83b8c039d9 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -1,5 +1,6 @@ /* ANSI and traditional C compatability macros - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, + 2002, 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -114,6 +115,10 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #ifndef _ANSIDECL_H #define _ANSIDECL_H 1 +#ifdef __cplusplus +extern "C" { +#endif + /* Every source file includes this file, so they will all get the switch for lint. */ /* LINTLIBRARY */ @@ -136,7 +141,7 @@ So instead we use the macro below and test it against specific values. */ #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) #endif /* GCC_VERSION */ -#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus)) +#if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) /* All known AIX compilers implement these things (but don't always define __STDC__). The RISC/OS MIPS compiler defines these things in SVR4 mode, but does not define __STDC__. */ @@ -173,7 +178,7 @@ So instead we use the macro below and test it against specific values. */ /* inline requires special treatment; it's in C99, and GCC >=2.7 supports it too, but it's not in C89. */ #undef inline -#if __STDC_VERSION__ > 199901L +#if __STDC_VERSION__ > 199901L || defined(__cplusplus) /* it's a keyword */ #else # if GCC_VERSION >= 2007 @@ -390,4 +395,8 @@ So instead we use the macro below and test it against specific values. */ #define __extension__ #endif +#ifdef __cplusplus +} +#endif + #endif /* ansidecl.h */ |