Define __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS again.
authorPedro Alves <palves@redhat.com>
Tue, 25 Oct 2016 10:47:18 +0000 (11:47 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 25 Oct 2016 10:47:18 +0000 (11:47 +0100)
Revert commit f6abaf7a4088 (gdb: no longer define
__STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS), with the tweak suggested
in that commit's log: the macros are now defined before any system
header is included.

This should fix AIX:
  https://sourceware.org/ml/gdb-patches/2016-10/msg00682.html

gdb/ChangeLog:
2016-10-25  Pedro Alves  <palves@redhat.com>

       * common/common-defs.h (__STDC_CONSTANT_MACROS)
       (__STDC_LIMIT_MACROS): Define.

gdb/ChangeLog
gdb/common/common-defs.h

index 5541086d55c6501b7aaef8173da3c93f55853e46..40fab9bcd1ef134a161a7e8ab2cd1ce6aa382995 100644 (file)
@@ -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
index 9b5d853c255e0cfcb3806f1b48818b103f6dbe34..3d5ff188278a5b0de86c7c280f083809502a6ba7 100644 (file)
 #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>
This page took 0.029331 seconds and 4 git commands to generate.