diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2024-11-25 14:03:27 -0800 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2024-11-25 14:36:41 -0800 |
commit | f6e00226a4ca63e76e3e0b3a09a4ce6223980981 (patch) | |
tree | 84d96494861c1babbf0c8b7c877b09c5f858aaf3 /gcc/system.h | |
parent | c61576d89eb0fead37be39fcf0764bb915ea201f (diff) | |
download | gcc-f6e00226a4ca63e76e3e0b3a09a4ce6223980981.zip gcc-f6e00226a4ca63e76e3e0b3a09a4ce6223980981.tar.gz gcc-f6e00226a4ca63e76e3e0b3a09a4ce6223980981.tar.bz2 |
build: Move sstream include above safe-ctype.h {PR117771]
sstream in some versions of libstdc++ include locale which might not have been
included yet. safe-ctype.h defines the toupper, tolower, etc. as macros so the
c++ header files needed to be included before hand as comment in system.h says:
/* Include C++ standard headers before "safe-ctype.h" to avoid GCC
poisoning the ctype macros through safe-ctype.h */
I don't understand how it was working before when memory was included after
safe-ctype.h rather than before. But this makes sstream consistent with the
other C++ headers.
Pushed as obvious after a build for riscv64-elf.
gcc/ChangeLog:
PR target/117771
* system.h: Move the include of sstream above safe-ctype.h.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/system.h')
-rw-r--r-- | gcc/system.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/system.h b/gcc/system.h index c209871..57ce22a 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -222,6 +222,9 @@ extern int fprintf_unlocked (FILE *, const char *, ...); #ifdef INCLUDE_FUNCTIONAL # include <functional> #endif +#ifdef INCLUDE_SSTREAM +# include <sstream> +#endif # include <memory> # include <cstring> # include <initializer_list> @@ -764,10 +767,6 @@ private: # include <mutex> #endif -#ifdef INCLUDE_SSTREAM -# include <sstream> -#endif - #ifdef INCLUDE_MALLOC_H #if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2) #include <malloc.h> |