]> granicus.if.org Git - llvm/commitdiff
Do not require __STDC_LIMIT_MACROS and others
authorPawel Bylica <chfast@gmail.com>
Wed, 22 Jun 2016 21:15:51 +0000 (21:15 +0000)
committerPawel Bylica <chfast@gmail.com>
Wed, 22 Jun 2016 21:15:51 +0000 (21:15 +0000)
Summary: Do not require __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS macros to be defined globally. They are not needed for C++11 compliant standard headers.

Reviewers: joerg, jyknight

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D21553

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273493 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/DataTypes.h.cmake

index 71aa1ea1a8c06b25a039e000ac5fdc651c2a05dd..541dbc3d635d7abcb61465e1ab42baba658f37ba 100644 (file)
 
 #ifndef _MSC_VER
 
-/* Note that this header's correct operation depends on __STDC_LIMIT_MACROS
-   being defined.  We would define it here, but in order to prevent Bad Things
-   happening when system headers or C++ STL headers include stdint.h before we
-   define it here, we define it on the g++ command line (in Makefile.rules). */
-#if !defined(__STDC_LIMIT_MACROS)
-# error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
+#if !defined(UINT32_MAX)
+# error "The standard header <cstdint> is not C++11 compliant. Must #define "\
+        "__STDC_LIMIT_MACROS before #including Support/DataTypes.h"
 #endif
 
-#if !defined(__STDC_CONSTANT_MACROS)
-# error "Must #define __STDC_CONSTANT_MACROS before " \
-        "#including Support/DataTypes.h"
+#if !defined(UINT32_C)
+# error "The standard header <cstdint> is not C++11 compliant. Must #define "\
+        "__STDC_CONSTANT_MACROS before #including Support/DataTypes.h"
 #endif
 
 /* Note that <inttypes.h> includes <stdint.h>, if this is a C99 system. */