Commit 86ff5c50 by Benjamin Kosnik Committed by Benjamin Kosnik

re PR libstdc++/36130 (Atomics regression test fail to compile when parallel mode is enabled)

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.

From-SVN: r134995
parent a6ce2774
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:
......
......@@ -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.
......
// { 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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment