Skip to content

Commit cf416e0

Browse files
authored
[libc] Use proxy headers for limits.h values (llvm#102378)
Summary: This defines some constants that may conflict with the system when in overlay mode. Use the proxy header instead. Fixes: llvm#102368
1 parent cece4ba commit cf416e0

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

libc/src/__support/CPP/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ add_header_library(
4747
limits.h
4848
DEPENDS
4949
.type_traits
50+
libc.hdr.limits_macros
5051
libc.include.llvm-libc-macros.limits_macros
5152
libc.src.__support.macros.properties.types
5253
)

libc/src/__support/CPP/limits.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_LIMITS_H
1010
#define LLVM_LIBC_SRC___SUPPORT_CPP_LIMITS_H
1111

12-
#include "include/llvm-libc-macros/limits-macros.h" // CHAR_BIT
12+
#include "hdr/limits_macros.h" // CHAR_BIT
1313
#include "src/__support/CPP/type_traits/is_integral.h"
1414
#include "src/__support/CPP/type_traits/is_signed.h"
15-
#include "src/__support/macros/attributes.h" // LIBC_INLINE
15+
#include "src/__support/macros/attributes.h" // LIBC_INLINE
1616
#include "src/__support/macros/config.h"
1717
#include "src/__support/macros/properties/types.h" // LIBC_TYPES_HAS_INT128
1818

utils/bazel/llvm-project-overlay/libc/BUILD.bazel

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ libc_support_library(
150150
hdrs = ["hdr/stdio_macros.h"],
151151
)
152152

153+
154+
libc_support_library(
155+
name = "hdr_limits_macros",
156+
hdrs = ["hdr/limits_macros.h"],
157+
)
158+
153159
############################ Type Proxy Header Files ###########################
154160

155161
libc_support_library(
@@ -362,7 +368,7 @@ libc_support_library(
362368
"__support_cpp_type_traits",
363369
"__support_macros_attributes",
364370
":__support_macros_properties_types",
365-
":llvm_libc_macros_limits_macros",
371+
":hdr_limits_macros",
366372
],
367373
)
368374

0 commit comments

Comments
 (0)