From: Pawel Bylica Date: Wed, 22 Jun 2016 21:15:51 +0000 (+0000) Subject: Do not require __STDC_LIMIT_MACROS and others X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b666b16816dad647849fb1a453d64a4306265df;p=llvm Do not require __STDC_LIMIT_MACROS and others 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 --- diff --git a/include/llvm/Support/DataTypes.h.cmake b/include/llvm/Support/DataTypes.h.cmake index 71aa1ea1a8c..541dbc3d635 100644 --- a/include/llvm/Support/DataTypes.h.cmake +++ b/include/llvm/Support/DataTypes.h.cmake @@ -55,17 +55,14 @@ #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 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 is not C++11 compliant. Must #define "\ + "__STDC_CONSTANT_MACROS before #including Support/DataTypes.h" #endif /* Note that includes , if this is a C99 system. */