From ee4d8ffed4f0620ba7618c104973f4f0fd7de164 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 6 Jan 2016 14:17:16 -0800 Subject: [PATCH] Make minidump-2-core.cc build with -Wformat. A=thakis@chromium.org BUG=chromium:574817 Original Review: https://codereview.chromium.org/1562983002/ R=thakis@chromium.org Review URL: https://codereview.chromium.org/1563043002 . --- src/google_breakpad/common/breakpad_types.h | 6 ++++++ src/tools/linux/md2core/minidump-2-core.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/google_breakpad/common/breakpad_types.h b/src/google_breakpad/common/breakpad_types.h index c936e1e6..d8828043 100644 --- a/src/google_breakpad/common/breakpad_types.h +++ b/src/google_breakpad/common/breakpad_types.h @@ -40,6 +40,12 @@ #ifndef GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__ #define GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__ +#if (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && \ + !defined(__STDC_FORMAT_MACROS) +#error "inttypes.h has already been included before this header file, but " +#error "without __STDC_FORMAT_MACROS defined." +#endif + #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif /* __STDC_FORMAT_MACROS */ diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc index 8e9cd129..102ce677 100644 --- a/src/tools/linux/md2core/minidump-2-core.cc +++ b/src/tools/linux/md2core/minidump-2-core.cc @@ -35,7 +35,6 @@ #include #include -#include #include #include #include @@ -50,6 +49,7 @@ #include "common/linux/memory_mapped_file.h" #include "common/minidump_type_helper.h" #include "common/scoped_ptr.h" +#include "google_breakpad/common/breakpad_types.h" #include "google_breakpad/common/minidump_format.h" #include "third_party/lss/linux_syscall_support.h" #include "tools/linux/md2core/minidump_memory_range.h"