aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/common/common-defs.h13
2 files changed, 18 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5541086..40fab9b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-25 Pedro Alves <palves@redhat.com>
+
+ * common/common-defs.h (__STDC_CONSTANT_MACROS)
+ (__STDC_LIMIT_MACROS): Define.
+
2016-10-25 Yao Qi <yao.qi@linaro.org>
PR gdb/20716
diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h
index 9b5d853..3d5ff18 100644
--- a/gdb/common/common-defs.h
+++ b/gdb/common/common-defs.h
@@ -27,6 +27,19 @@
#include "build-gnulib/config.h"
#endif
+/* From:
+ https://www.gnu.org/software/gnulib/manual/html_node/stdint_002eh.html
+
+ "On some hosts that predate C++11, when using C++ one must define
+ __STDC_CONSTANT_MACROS to make visible the definitions of constant
+ macros such as INTMAX_C, and one must define __STDC_LIMIT_MACROS to
+ make visible the definitions of limit macros such as INTMAX_MAX.".
+
+ Must do this before including any system header, since system
+ headers may include stdint.h. */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>