Add -D__STDC_FORMAT_MACROS to use PRIx64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141663 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Makefile.rules b/Makefile.rules
index 4d30d45..d057f04 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -623,7 +623,7 @@
endif # !HOST_OS - AuroraUX.
LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
-CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
+CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
# All -I flags should go here, so that they don't confuse llvm-config.
CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
$(patsubst %,-I%/include,\
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 908bf6c..9dc1624 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -187,6 +187,7 @@
endif( MSVC )
add_llvm_definitions( -D__STDC_CONSTANT_MACROS )
+add_llvm_definitions( -D__STDC_FORMAT_MACROS )
add_llvm_definitions( -D__STDC_LIMIT_MACROS )
option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
diff --git a/include/llvm/Support/DataTypes.h.cmake b/include/llvm/Support/DataTypes.h.cmake
index 260ed9b..23d87fb 100644
--- a/include/llvm/Support/DataTypes.h.cmake
+++ b/include/llvm/Support/DataTypes.h.cmake
@@ -164,6 +164,11 @@
#ifndef UINT64_C
# define UINT64_C(C) C##ui64
#endif
+
+#ifndef PRIx64
+# define PRIx64 "I64x"
+#endif
+
#endif /* _MSC_VER */
/* Set defaults for constants which we cannot find. */