+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:
namespace tr1 { }
}
*/
+#if __cplusplus
#ifdef _GLIBCXX_DEBUG
# define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
// _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
#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 { }
// 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.
--- /dev/null
+// { 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>