diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-06 18:57:46 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-06 18:57:46 +0000 |
commit | 6918f040486075fcde4edaa37583043c658083ff (patch) | |
tree | 08b01e99ae3892370da10eda2e790046d7563514 /libstdc++-v3 | |
parent | b9940fd2f816074a84167907683717506421afc7 (diff) | |
download | gcc-6918f040486075fcde4edaa37583043c658083ff.tar.gz |
2008-05-06 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36130
* include/bits/c++config: Namespace macros and setup only in C++.
* testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134995 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/c++config | 17 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/debug_mode.c | 23 |
3 files changed, 36 insertions, 10 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b5201c5b332..f50f917c4f2 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2008-05-06 Benjamin Kosnik <bkoz@redhat.com> + + PR libstdc++/36130 + * include/bits/c++config: Namespace macros and setup only in C++. + * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: New. + 2008-05-06 Johannes Singler <singler@ira.uka.de> * include/parallel/multiway_merge.h: diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index f967bd27cee..f4029b26665 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -80,6 +80,7 @@ namespace tr1 { } } */ +#if __cplusplus #ifdef _GLIBCXX_DEBUG # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1 @@ -103,15 +104,12 @@ // _GLIBCXX_STD // _GLIBCXX_STD_D // _GLIBCXX_STD_P - // // Macros for enclosing namespaces and possibly nested namespaces. // _GLIBCXX_BEGIN_NAMESPACE // _GLIBCXX_END_NAMESPACE // _GLIBCXX_BEGIN_NESTED_NAMESPACE // _GLIBCXX_END_NESTED_NAMESPACE -// _GLIBCXX_BEGIN_POTENTIAL_NESTED_NAMESPACE -// _GLIBCXX_END_POTENTIAL_NESTED_NAMESPACE #ifndef _GLIBCXX_USE_NAMESPACE_ASSOCIATION # define _GLIBCXX_STD_D _GLIBCXX_STD # define _GLIBCXX_STD_P _GLIBCXX_STD @@ -215,8 +213,7 @@ namespace std #undef _GLIBCXX_LONG_DOUBLE_COMPAT // Namespace associations for long double 128 mode. -#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \ - && defined __cplusplus +#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ namespace std { inline namespace __gnu_cxx_ldbl128 { } @@ -232,17 +229,17 @@ namespace std // Defines for C compatibility. In particular, define extern "C" -// linkage only when using C++, same with namespaces. -#if __cplusplus +// linkage only when using C++. # define _GLIBCXX_BEGIN_EXTERN_C extern "C" { # define _GLIBCXX_END_EXTERN_C } -#else -# define _GLIBCXX_BEGIN_EXTERN_C -# define _GLIBCXX_END_EXTERN_C + +#else // !__cplusplus # undef _GLIBCXX_BEGIN_NAMESPACE # undef _GLIBCXX_END_NAMESPACE # define _GLIBCXX_BEGIN_NAMESPACE(X) # define _GLIBCXX_END_NAMESPACE +# define _GLIBCXX_BEGIN_EXTERN_C +# define _GLIBCXX_END_EXTERN_C #endif // First includes. diff --git a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/debug_mode.c b/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/debug_mode.c new file mode 100644 index 00000000000..8b2c857e290 --- /dev/null +++ b/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/debug_mode.c @@ -0,0 +1,23 @@ +// { dg-options "-x c -D_GLIBCXX_DEBUG" } +// { dg-do compile } + +// Copyright (C) 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 +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// libstdc++/36130 +#include <stdatomic.h> |