common/common-defs.h: Define __STDC_FORMAT_MACROS as well
authorPedro Alves <palves@redhat.com>
Tue, 25 Oct 2016 12:50:20 +0000 (13:50 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 25 Oct 2016 12:50:20 +0000 (13:50 +0100)
Ref: https://sourceware.org/ml/gdb-patches/2016-10/msg00694.html

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

* common/common-defs.h (__STDC_FORMAT_MACROS): Define.

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

index c2a8579a5c2765ceda29bbbc612036ffeafb1569..1f588217e8b1ef2366061a867d9c455080911263 100644 (file)
@@ -1,3 +1,7 @@
+2016-10-25  Pedro Alves  <palves@redhat.com>
+
+       * common/common-defs.h (__STDC_FORMAT_MACROS): Define.
+
 2016-10-25  Pedro Alves  <palves@redhat.com>
 
        * common/new-op.c: Add comment about -fsanitize=address.
index 3d5ff188278a5b0de86c7c280f083809502a6ba7..8fbb4bf9442691e425ceeb02ac073f1b1bc2b9a8 100644 (file)
    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.  */
+   And:
+    https://www.gnu.org/software/gnulib/manual/html_node/inttypes_002eh.html
+
+   "On some hosts that predate C++11, when using C++ one must define
+   __STDC_FORMAT_MACROS to make visible the declarations of format
+   macros such as PRIdMAX."
+
+   Must do this before including any system header, since other system
+   headers may include stdint.h/inttypes.h.  */
 #define __STDC_CONSTANT_MACROS 1
 #define __STDC_LIMIT_MACROS 1
+#define __STDC_FORMAT_MACROS 1
 
 #include <stdarg.h>
 #include <stdio.h>
This page took 0.028925 seconds and 4 git commands to generate.