aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/common/common-defs.h16
2 files changed, 21 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fbfe4ad..d326b9c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2015-11-17 Pedro Alves <palves@redhat.com>
+ * common/common-defs.h (__STDC_CONSTANT_MACROS)
+ (__STDC_LIMIT_MACROS): Define before including stdint.h.
+
+2015-11-17 Pedro Alves <palves@redhat.com>
+
* windows-nat.c (handle_exception): Return 0 for first chance
exceptions.
(get_windows_debug_event): Adjust.
diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h
index 2be0d7d..548fe42 100644
--- a/gdb/common/common-defs.h
+++ b/gdb/common/common-defs.h
@@ -31,7 +31,23 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
+
+/* 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."
+
+ gnulib doesn't fix this for us correctly yet. See:
+ https://lists.gnu.org/archive/html/bug-gnulib/2015-11/msg00004.html
+
+ Meanwhile, explicitly define these ourselves, as C99 intended. */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
#include <stdint.h>
+
#include <string.h>
#include <errno.h>
#include <alloca.h>