Commit aee7846e by Mark Mitchell Committed by Mark Mitchell

c-cppbuiltin.c (c_cpp_builtins): Do not define __GXX_WEAK__ to 1 if !flag_weak.

	* c-cppbuiltin.c (c_cpp_builtins): Do not define __GXX_WEAK__ to 1
	if !flag_weak.
	* doc/cpp.texi (__DEPRECATED): Document.
	(__EXCEPTIONS): Likewise.
	(__GXX_WEAK__): Likewise.

	* g++.dg/cpp/weak.C: New test.

From-SVN: r99080
parent 3a57c6cb
2005-05-01 Mark Mitchell <mark@codesourcery.com>
* c-cppbuiltin.c (c_cpp_builtins): Do not define __GXX_WEAK__ to 1
if !flag_weak.
* doc/cpp.texi (__DEPRECATED): Document.
(__EXCEPTIONS): Likewise.
(__GXX_WEAK__): Likewise.
* function.c (INVOKE__main): Do not define.
(expand_main_function): Check HAS_INIT_SECTION when determining
whether or not to call __main.
......
......@@ -328,7 +328,7 @@ c_cpp_builtins (cpp_reader *pfile)
if (c_dialect_cxx ())
{
if (SUPPORTS_ONE_ONLY)
if (flag_weak && SUPPORTS_ONE_ONLY)
cpp_define (pfile, "__GXX_WEAK__=1");
else
cpp_define (pfile, "__GXX_WEAK__=0");
......
......@@ -2081,11 +2081,31 @@ respectively. They exist to make the standard header given numerical limits
work correctly. You should not use these macros directly; instead, include
the appropriate headers.
@item __DEPRECATED
This macro is defined, with value 1, when compiling a C++ source file
with warnings about deprecated constructs enabled. These warnings are
enabled by default, but can be disabled with @option{-Wno-deprecated}.
@item __EXCEPTIONS
This macro is defined, with value 1, when compiling a C++ source file
with exceptions enabled. If @option{-fno-exceptions} was used when
compiling the file, then this macro will not be defined.
@item __USING_SJLJ_EXCEPTIONS__
This macro is defined, with value 1, if the compiler uses the old
mechanism based on @code{setjmp} and @code{longjmp} for exception
handling.
@item __GXX_WEAK__
This macro is defined when compiling a C++ source file. It has the
value 1 if the compiler will use weak symbols, COMDAT sections, or
other similar techniques to collapse symbols with ``vague linkage''
that are defined in multiple translation units. If the compiler will
not collapse such symbols, this macro is defined with value 0. In
general, user code should not need to make use of this macro; the
purpose of this macro is to ease implementation of the C++ runtime
library provided with G++.
@item __NEXT_RUNTIME__
This macro is defined, with value 1, if (and only if) the NeXT runtime
(as in @option{-fnext-runtime}) is in use for Objective-C@. If the GNU
......
2005-05-01 Mark Mitchell <mark@codesourcery.com>
* g++.dg/cpp/weak.C: New test.
2005-05-01 Zdenek Dvorak <dvorakz@suse.cz>
* gcc.dg/tree-ssa/loop-8.c: New test.
......
// { dg-options "-fno-weak" }
#if __GXX_WEAK__
#error "__GXX_WEAK__ defined when -fno-weak in use"
#endif
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