Skip to content

Commit a023a95

Browse files
authored
Do not require __STDC_LIMIT_MACROS and others (microsoft#6976)
Apply LLVM patch: https://reviews.llvm.org/D21553 GitHub commit: llvm/llvm-project@f4437e9#diff-5fb0c3e347a7fc69d806be92c7b786cda1018152b3d264e3293697a1ac41eb7eR61 This fixes compilation of DXC with latest libc++, which removes C headers like locale.h and stdint.h: llvm/llvm-project@aa7f377
1 parent db90a46 commit a023a95

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

include/llvm/Support/DataTypes.h.cmake

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,14 @@
4949

5050
#ifndef _MSC_VER
5151

52-
/* Note that this header's correct operation depends on __STDC_LIMIT_MACROS
53-
being defined. We would define it here, but in order to prevent Bad Things
54-
happening when system headers or C++ STL headers include stdint.h before we
55-
define it here, we define it on the g++ command line (in Makefile.rules). */
56-
#if !defined(__STDC_LIMIT_MACROS)
57-
# error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
52+
#if !defined(UINT32_MAX)
53+
# error "The standard header <cstdint> is not C++11 compliant. Must #define "\
54+
"__STDC_LIMIT_MACROS before #including Support/DataTypes.h"
5855
#endif
5956

60-
#if !defined(__STDC_CONSTANT_MACROS)
61-
# error "Must #define __STDC_CONSTANT_MACROS before " \
62-
"#including Support/DataTypes.h"
57+
#if !defined(UINT32_C)
58+
# error "The standard header <cstdint> is not C++11 compliant. Must #define "\
59+
"__STDC_CONSTANT_MACROS before #including Support/DataTypes.h"
6360
#endif
6461

6562
/* Note that <inttypes.h> includes <stdint.h>, if this is a C99 system. */

0 commit comments

Comments
 (0)