Move __STDC_FORMAT_MACROS to a cflag.
Current inttypes.h don't define stdint printf formatting characters for C++ but
in the future this will change. Rather than #define __STDC_FORMAT_MACROS at the
point of inclusion (conventional) pass it as a cflag so there is a single place
to remove the #define when conventions change.
Change-Id: Ice2fb07e19d8fc06ebc534c903a2d02497c31b3d
diff --git a/build/Android.common.mk b/build/Android.common.mk
index 415d810..0f4ade3 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -182,6 +182,9 @@
# Make host builds easier to debug and profile by not omitting the frame pointer.
ART_HOST_CFLAGS += -fno-omit-frame-pointer
+# Workaround differences in inttypes.h.
+ART_HOST_CFLAGS += -D__STDC_FORMAT_MACROS=1
+
# To use oprofile_android --callgraph, uncomment this and recompile with "mmm art -B -j16"
# ART_TARGET_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
diff --git a/runtime/base/mutex-inl.h b/runtime/base/mutex-inl.h
index 30bf623..a7e25cb 100644
--- a/runtime/base/mutex-inl.h
+++ b/runtime/base/mutex-inl.h
@@ -17,7 +17,6 @@
#ifndef ART_RUNTIME_BASE_MUTEX_INL_H_
#define ART_RUNTIME_BASE_MUTEX_INL_H_
-#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
#include "mutex.h"
diff --git a/runtime/mem_map.cc b/runtime/mem_map.cc
index b07cf5c..d3b8236 100644
--- a/runtime/mem_map.cc
+++ b/runtime/mem_map.cc
@@ -16,7 +16,6 @@
#include "mem_map.h"
-#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
#include <backtrace/BacktraceMap.h>