aboutsummaryrefslogtreecommitdiff
path: root/gold/binary.cc
diff options
context:
space:
mode:
authorRoland McGrath <mcgrathr@chromium.org>2015-12-16 16:35:27 -0800
committerRoland McGrath <mcgrathr@chromium.org>2015-12-16 16:35:27 -0800
commit95c29a83ebadd0038fd304539a83c5e90798c1b9 (patch)
tree28ce7f25ee567790ccad282dd9f26f6090a5cb53 /gold/binary.cc
parenteedd1410d342a8305f7063457d9090ff0de2366e (diff)
downloadgdb-95c29a83ebadd0038fd304539a83c5e90798c1b9.zip
gdb-95c29a83ebadd0038fd304539a83c5e90798c1b9.tar.gz
gdb-95c29a83ebadd0038fd304539a83c5e90798c1b9.tar.bz2
PR gold/17473: Fix gold build with system C++ headers that use <ctype.h>.
gold/ PR gold/17473 * binary.cc: Move #include "safe-ctype.h" to be last #include.
Diffstat (limited to 'gold/binary.cc')
-rw-r--r--gold/binary.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gold/binary.cc b/gold/binary.cc
index 12ca296..52df81a 100644
--- a/gold/binary.cc
+++ b/gold/binary.cc
@@ -24,7 +24,6 @@
#include <cerrno>
#include <cstring>
-#include "safe-ctype.h"
#include "elfcpp.h"
#include "stringpool.h"
@@ -32,6 +31,13 @@
#include "output.h"
#include "binary.h"
+// safe-ctype.h interferes with macros defined by the system <ctype.h>.
+// Some C++ system headers might include <ctype.h> and rely on its macro
+// definitions being intact. So make sure that safe-ctype.h is included
+// only after any C++ system headers, whether directly here (above) or via
+// other local header files (e.g. #include <string> in "binary.h").
+#include "safe-ctype.h"
+
// Support for reading binary files as input. These become blobs in
// the final output. These files are treated as though they have a
// single .data section and define three symbols: