diff --git a/gcc/gcc/system.h b/gcc/gcc/system.h index 2a8b7786c6..33de8cfb63 100644 --- a/gcc/gcc/system.h +++ b/gcc/gcc/system.h @@ -194,28 +194,6 @@ extern int fprintf_unlocked (FILE *, const char *, ...); #undef fread_unlocked #undef fwrite_unlocked -/* Include before "safe-ctype.h" to avoid GCC poisoning - the ctype macros through safe-ctype.h */ - -#ifdef __cplusplus -#ifdef INCLUDE_STRING -# include -#endif -#endif - -/* There are an extraordinary number of issues with . - The last straw is that it varies with the locale. Use libiberty's - replacement instead. */ -#include "safe-ctype.h" - -#include - -#include - -#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO -extern int errno; -#endif - #ifdef __cplusplus #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY) # include @@ -229,6 +207,11 @@ extern int errno; #ifdef INCLUDE_SET # include #endif +/* Include before "safe-ctype.h" to avoid GCC poisoning + the ctype macros through safe-ctype.h */ +#ifdef INCLUDE_STRING +# include +#endif #ifdef INCLUDE_VECTOR # include #endif @@ -245,6 +228,17 @@ extern int errno; # include #endif +/* There are an extraordinary number of issues with . + The last straw is that it varies with the locale. Use libiberty's + replacement instead. */ +#include "safe-ctype.h" +#include +#include + +#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO +extern int errno; +#endif + /* Some of glibc's string inlines cause warnings. Plus we'd rather rely on (and therefore test) GCC's string builtins. */ #define __NO_STRING_INLINES diff --git a/gcc/libcc1/libcc1plugin.cc b/gcc/libcc1/libcc1plugin.cc index bdd0bdabe7..863e1665ee 100644 --- a/gcc/libcc1/libcc1plugin.cc +++ b/gcc/libcc1/libcc1plugin.cc @@ -31,6 +31,7 @@ #undef PACKAGE_TARNAME #undef PACKAGE_VERSION +#define INCLUDE_VECTOR #define INCLUDE_MEMORY #include "gcc-plugin.h" #include "system.h" @@ -69,7 +70,6 @@ #include "gcc-c-interface.h" #include "context.hh" -#include using namespace cc1_plugin; diff --git a/gcc/libcc1/libcp1plugin.cc b/gcc/libcc1/libcp1plugin.cc index e2d5039a0a..eeccb74f14 100644 --- a/gcc/libcc1/libcp1plugin.cc +++ b/gcc/libcc1/libcp1plugin.cc @@ -33,6 +33,7 @@ #undef PACKAGE_VERSION #define INCLUDE_MEMORY +#define INCLUDE_VECTOR #include "gcc-plugin.h" #include "system.h" #include "coretypes.h" @@ -71,7 +72,6 @@ #include "rpc.hh" #include "context.hh" -#include using namespace cc1_plugin;