Skip to content

Commit 13bbca8

Browse files
committed
[libc] [NFC] explain compiler macros in limits.h
Differential Revision: https://reviews.llvm.org/D158128
1 parent 314a5d7 commit 13bbca8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libc/include/llvm-libc-macros/limits-macros.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#ifndef __LLVM_LIBC_MACROS_LIMITS_MACROS_H
22
#define __LLVM_LIBC_MACROS_LIMITS_MACROS_H
33

4+
// Normally compiler headers will be prefered over LLVM-libc headers and
5+
// include_next this header, however, during LLVM-libc build itself the
6+
// LLVM-libc headers are prefered, and to get C numerical limits we need to
7+
// include compiler (freestanding) limits.h. The macro checks are here to avoid
8+
// including limits.h when compiler headers have already been included.
9+
410
#if !defined _GCC_LIMITS_H_ && !defined __CLANG_LIMITS_H && \
511
__has_include_next(<limits.h>)
612
#include_next <limits.h>

0 commit comments

Comments
 (0)