diff options
Diffstat (limited to 'libstdc++-v3/include/bits/c++config')
-rw-r--r-- | libstdc++-v3/include/bits/c++config | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index d42cb9feb47..e38cfe05184 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -1,7 +1,7 @@ // Predefined symbols and macros -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007 Free Software Foundation, Inc. +// 2006, 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -216,6 +216,20 @@ namespace std } #endif +// Defines for C compatibility. In particular, define extern "C" +// linkage only when using C++, same with namespaces. +#if __cplusplus +# define _GLIBCXX_BEGIN_EXTERN_C extern "C" { +# define _GLIBCXX_END_EXTERN_C } +#else +# define _GLIBCXX_BEGIN_EXTERN_C +# define _GLIBCXX_END_EXTERN_C +# undef _GLIBCXX_BEGIN_NAMESPACE +# undef _GLIBCXX_END_NAMESPACE +# define _GLIBCXX_BEGIN_NAMESPACE(X) +# define _GLIBCXX_END_NAMESPACE +#endif + // Define if compatibility should be provided for -mlong-double-64. #undef _GLIBCXX_LONG_DOUBLE_COMPAT |