Add -D__STDC_FORMAT_MACROS to use PRIx64.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 11 Oct 2011 12:51:44 +0000 (12:51 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 11 Oct 2011 12:51:44 +0000 (12:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141663 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.rules
cmake/modules/HandleLLVMOptions.cmake
include/llvm/Support/DataTypes.h.cmake

index 4d30d45b676d8aee6f9f576d277fccf5092a5029..d057f043ff640bd2214741efa269b41c04cbe998 100644 (file)
@@ -623,7 +623,7 @@ CPP.BaseFlags += -include llvm/Support/Solaris.h
 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,\
index 908bf6cce9c9c938e699815370eb99640a1841f6..9dc1624f446c40668f4f15c9b6156bdb02f20ccf 100644 (file)
@@ -187,6 +187,7 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
 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)
index 260ed9bb5c4b10768316d7c25c42ce7cafc8e474..23d87fbb8919b331c3011b75dd68b0cf92f37cfa 100644 (file)
@@ -164,6 +164,11 @@ typedef signed int ssize_t;
 #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. */