aboutsummaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-01-22 16:44:10 +0000
committerMichael Matz <matz@gcc.gnu.org>2016-01-22 16:44:10 +0000
commit017360184d9eabff8d1479b3ed09bd1a5b11ff11 (patch)
tree93cc6b7235cf5430477fce1662a210a0904b17e9 /gcc/system.h
parent6041f70ae3c9822a41046a7826c1d33818d346bd (diff)
downloadgcc-017360184d9eabff8d1479b3ed09bd1a5b11ff11.zip
gcc-017360184d9eabff8d1479b3ed09bd1a5b11ff11.tar.gz
gcc-017360184d9eabff8d1479b3ed09bd1a5b11ff11.tar.bz2
system.h (string, algorithm): Include only conditionally.
* system.h (string, algorithm): Include only conditionally. (new): Include always under C++. * bb-reorder.c (toplevel): Define INCLUDE_ALGORITHM. * final.c (toplevel): Ditto. * ipa-chkp.c (toplevel): Define INCLUDE_STRING. * genconditions.c (write_header): Make gencondmd.c define INCLUDE_STRING. * mem-stats.h (mem_usage::print_dash_line): Don't use std::string. * config/aarch64/aarch64.c (toplevel): Define INCLUDE_STRING. * common/config/aarch64/aarch64-common.c (toplevel): Ditto. From-SVN: r232736
Diffstat (limited to 'gcc/system.h')
-rw-r--r--gcc/system.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/system.h b/gcc/system.h
index ba2e963..8151e0a 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -198,8 +198,10 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
the ctype macros through safe-ctype.h */
#ifdef __cplusplus
+#ifdef INCLUDE_STRING
# include <string>
#endif
+#endif
/* There are an extraordinary number of issues with <ctype.h>.
The last straw is that it varies with the locale. Use libiberty's
@@ -215,8 +217,11 @@ extern int errno;
#endif
#ifdef __cplusplus
+#ifdef INCLUDE_ALGORITHM
# include <algorithm>
+#endif
# include <cstring>
+# include <new>
# include <utility>
#endif