X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fc-cppbuiltin.c;h=9020e0b49f9493c3e1a2bcdbd87fc73d352a1cf0;hb=c9d8753c393285ea9685bcdc894e4b7588d2a577;hp=2c9039ef45fa697df3d04daf9791a2fec632394a;hpb=2a5cd7f7a5561b0bda54ed4993cea251af36e7af;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c index 2c9039ef45f..9020e0b49f9 100644 --- a/gcc/c-cppbuiltin.c +++ b/gcc/c-cppbuiltin.c @@ -1,5 +1,5 @@ /* Define builtin-in macros for the C family front ends. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ +Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ #include "config.h" #include "system.h" @@ -275,7 +275,7 @@ define__GNUC__ (void) if (c_dialect_cxx ()) builtin_define_with_value_n ("__GNUG__", q, v - q); - gcc_assert (*v == '.' || ISDIGIT (v[1])); + gcc_assert (*v == '.' && ISDIGIT (v[1])); q = ++v; while (ISDIGIT (*v)) @@ -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"); @@ -440,6 +440,14 @@ c_cpp_builtins (cpp_reader *pfile) if (targetm.handle_pragma_extern_prefix) cpp_define (pfile, "__PRAGMA_EXTERN_PREFIX"); + /* Make the choice of the stack protector runtime visible to source code. + The macro names and values here were chosen for compatibility with an + earlier implementation, i.e. ProPolice. */ + if (flag_stack_protect == 2) + cpp_define (pfile, "__SSP_ALL__=2"); + else if (flag_stack_protect == 1) + cpp_define (pfile, "__SSP__=1"); + /* A straightforward target hook doesn't work, because of problems linking that hook's body when part of non-C front ends. */ # define preprocessing_asm_p() (cpp_get_options (pfile)->lang == CLK_ASM)