2 //===--------------------------- limits.h ---------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP_LIMITS_H
11 #define _LIBCPP_LIMITS_H
42 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
43 #pragma GCC system_header
47 #include_next <limits.h>
49 // GCC header limits.h recursively includes itself through another header called
50 // syslimits.h for some reason. This setup breaks down if we directly
51 // #include_next GCC's limits.h (reasons not entirely clear to me). Therefore,
52 // we manually re-create the necessary include sequence below:
54 // Get the system limits.h defines (force recurse into the next level)
55 #define _GCC_LIMITS_H_
56 #define _GCC_NEXT_LIMITS_H
57 #include_next <limits.h>
59 // Get the ISO C defines
61 #include_next <limits.h>
64 #endif // _LIBCPP_LIMITS_H