diff options
author | spth <spth@4a8a32a2-be11-0410-ad9d-d568d2c75423> | 2015-10-26 16:52:37 +0000 |
---|---|---|
committer | spth <spth@4a8a32a2-be11-0410-ad9d-d568d2c75423> | 2015-10-26 16:52:37 +0000 |
commit | f3dc00bb010282c3fc639f5cbfbcfa95f696ecfb (patch) | |
tree | 575ae58fcd877bb7d2b3ddaef9501c02fff0b589 /support/cpp/libcpp | |
parent | 356e29e3208b2ebb7a2320be33fae29312fd88c8 (diff) |
Merge cpp-merge-upstream branch to get improved standard support.
git-svn-id: https://svn.code.sourceforge.net/p/sdcc/code/trunk/sdcc@9379 4a8a32a2-be11-0410-ad9d-d568d2c75423
Diffstat (limited to 'support/cpp/libcpp')
-rw-r--r-- | support/cpp/libcpp/init.c | 2 | ||||
-rw-r--r-- | support/cpp/libcpp/system.h | 50 |
2 files changed, 29 insertions, 23 deletions
diff --git a/support/cpp/libcpp/init.c b/support/cpp/libcpp/init.c index 7960513c4..ccbc83df4 100644 --- a/support/cpp/libcpp/init.c +++ b/support/cpp/libcpp/init.c @@ -465,7 +465,7 @@ cpp_init_builtins (cpp_reader *pfile, int hosted) _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"); + _cpp_define_builtin (pfile, "__STDC_VERSION__ 201112L"); else if (CPP_OPTION (pfile, c99)) _cpp_define_builtin (pfile, "__STDC_VERSION__ 199901L"); diff --git a/support/cpp/libcpp/system.h b/support/cpp/libcpp/system.h index 187bf4a02..9dc83e66c 100644 --- a/support/cpp/libcpp/system.h +++ b/support/cpp/libcpp/system.h @@ -1,7 +1,6 @@ /* Get common system includes and various definitions and declarations based on autoconf macros. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2009, 2010 - Free Software Foundation, Inc. + Copyright (C) 1998-2014 Free Software Foundation, Inc. This file is part of GCC. @@ -44,6 +43,14 @@ along with GCC; see the file COPYING3. If not see #endif /* Use the unlocked open routines from libiberty. */ + +/* Some of these are #define on some systems, e.g. on AIX to redirect + the names to 64bit capable functions for LARGE_FILES support. These + redefs are pointless here so we can override them. */ + +#undef fopen +#undef freopen + #define fopen(PATH,MODE) fopen_unlocked(PATH,MODE) #define fdopen(FILDES,MODE) fdopen_unlocked(FILDES,MODE) #define freopen(PATH,MODE,STREAM) freopen_unlocked(PATH,MODE,STREAM) @@ -84,6 +91,10 @@ along with GCC; see the file COPYING3. If not see # define fputc(C, Stream) fputc_unlocked (C, Stream) # endif +#ifdef __cplusplus +extern "C" { +#endif + # ifdef HAVE_CLEARERR_UNLOCKED # undef clearerr # define clearerr(Stream) clearerr_unlocked (Stream) @@ -164,6 +175,10 @@ extern int fprintf_unlocked (FILE *, const char *, ...); # endif # endif +#ifdef __cplusplus +} +#endif + #endif /* ??? Glibc's fwrite/fread_unlocked macros cause @@ -286,10 +301,18 @@ extern int errno; here. These checks will be in the undefined state while configure is running so be careful to test "defined (HAVE_DECL_*)". */ +#ifdef __cplusplus +extern "C" { +#endif + #if defined (HAVE_DECL_ABORT) && !HAVE_DECL_ABORT extern void abort (void); #endif +#ifdef __cplusplus +} +#endif + #if HAVE_SYS_STAT_H # include <sys/stat.h> #endif @@ -345,33 +368,16 @@ extern void abort (void); /* Get libiberty declarations. */ #include "libiberty.h" -#if defined(__APPLE__) && defined(__MACH__) -#include <libiberty/safe-ctype.h> -#else -#include <safe-ctype.h> -#endif +#include "safe-ctype.h" /* 1 if we have C99 designated initializers. ??? C99 designated initializers are not supported by most C++ compilers, including G++. -- gdr, 2005-05-18 */ #if !defined(HAVE_DESIGNATED_INITIALIZERS) -#if defined(__APPLE__) && (__MACH__) -#define HAVE_DESIGNATED_INITIALIZERS 0 -#else #define HAVE_DESIGNATED_INITIALIZERS \ - ((!defined(__cplusplus) && (GCC_VERSION >= 2007)) \ - || (__STDC_VERSION__ >= 199901L)) -#endif -#endif - -/* Be conservative and only use enum bitfields with GCC. - FIXME: provide a complete autoconf test for buggy enum bitfields. */ - -#if (GCC_VERSION > 2000) -#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE -#else -#define ENUM_BITFIELD(TYPE) unsigned int + (!defined(__cplusplus) \ + && ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))) #endif #ifndef offsetof |