From 39012afb52bcbeb198c90671aaece181d542728a Mon Sep 17 00:00:00 2001 From: jsm28 Date: Sun, 25 Apr 2010 21:54:22 +0000 Subject: gcc: * c-common.c (flag_isoc1x): New. (flag_isoc99): Update comment. * c-common.h (flag_isoc1x): New. (flag_isoc99): Update comment. * c-cppbuiltin.c (builtin_define_float_constants): Also define ___DECIMAL_DIG__. * c-opts.c (set_std_c1x): New. (c_common_handle_option): Handle -std=c1x and -std=gnu1x. (set_std_c89, set_std_c99): Also set flag_isoc1x to 0. * c.opt (-std=c1x, -std=gnu1x): New options. * doc/cpp.texi: Mention -std=c1x. * doc/cppopts.texi (-std=c1x, -std=gnu1x): Document. * doc/extend.texi: Mention -std=c1x and -std=gnu1x. * doc/invoke.texi (-std=c1x, -std=gnu1x): Document. * doc/standards.texi: Mention C1X. * ginclude/float.h (FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, LDBL_DECIMAL_DIG, FLT_HAS_SUBNORM, DBL_HAS_SUBNORM, LDBL_HAS_SUBNORM, FLT_TRUE_MIN, DBL_TRUE_MIN, LDBL_TRUE_MIN): Define for C1X. gcc/testsuite: * gcc.dg/c90-float-1.c: Also test that C1X macros are not defined. * gcc.dg/c99-float-1.c: Also test that C1X macros are not defined. * gcc.dg/c1x-float-1.c: New test. libcpp: * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X. * init.c (lang_defaults): Add entries for new language variants. (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X variants. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158711 138bc75d-0d04-0410-961f-82ee72b054a4 --- libcpp/ChangeLog | 7 +++++++ libcpp/include/cpplib.h | 3 ++- libcpp/init.c | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'libcpp') diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 24838d3cd10..cc77ca013bc 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,10 @@ +2010-04-25 Joseph Myers + + * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X. + * init.c (lang_defaults): Add entries for new language variants. + (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X + variants. + 2010-04-09 Manuel López-Ibáñez PR cpp/43195 diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 9f29e6e63ae..0828ea40f93 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -155,7 +155,8 @@ enum cpp_ttype #undef TK /* C language kind, used when calling cpp_create_reader. */ -enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_STDC89, CLK_STDC94, CLK_STDC99, +enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_GNUC1X, + CLK_STDC89, CLK_STDC94, CLK_STDC99, CLK_STDC1X, CLK_GNUCXX, CLK_CXX98, CLK_GNUCXX0X, CLK_CXX0X, CLK_ASM}; /* Payload of a NUMBER, STRING, CHAR or COMMENT token. */ diff --git a/libcpp/init.c b/libcpp/init.c index f5bf0ea7b7d..ae5ae4548c8 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -84,9 +84,11 @@ static const struct lang_flags lang_defaults[] = { /* c99 c++ xnum xid std // digr ulit */ /* GNUC89 */ { 0, 0, 1, 0, 0, 1, 1, 0 }, /* GNUC99 */ { 1, 0, 1, 0, 0, 1, 1, 1 }, + /* GNUC1X */ { 1, 0, 1, 0, 0, 1, 1, 1 }, /* STDC89 */ { 0, 0, 0, 0, 1, 0, 0, 0 }, /* STDC94 */ { 0, 0, 0, 0, 1, 0, 1, 0 }, /* STDC99 */ { 1, 0, 1, 0, 1, 1, 1, 0 }, + /* STDC1X */ { 1, 0, 1, 0, 1, 1, 1, 0 }, /* GNUCXX */ { 0, 1, 1, 0, 0, 1, 1, 0 }, /* CXX98 */ { 0, 1, 1, 0, 1, 1, 1, 0 }, /* GNUCXX0X */ { 1, 1, 1, 0, 0, 1, 1, 1 }, @@ -457,6 +459,9 @@ cpp_init_builtins (cpp_reader *pfile, int hosted) _cpp_define_builtin (pfile, "__ASSEMBLER__ 1"); else if (CPP_OPTION (pfile, lang) == CLK_STDC94) _cpp_define_builtin (pfile, "__STDC_VERSION__ 199409L"); + else if (CPP_OPTION (pfile, lang) == CLK_STDC1X + || CPP_OPTION (pfile, lang) == CLK_GNUC1X) + _cpp_define_builtin (pfile, "__STDC_VERSION__ 201000L"); else if (CPP_OPTION (pfile, c99)) _cpp_define_builtin (pfile, "__STDC_VERSION__ 199901L"); -- cgit v1.2.3