Upgrade to 2022-era LLVM LIBCXX

This commit is contained in:
Justine Tunney 2024-05-27 02:12:27 -07:00
parent 2f4ca71f26
commit 8e68384e15
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2078 changed files with 165657 additions and 65010 deletions

View file

@ -1,5 +1,5 @@
// -*- C++ -*-
//===--------------------------- limits.h ---------------------------------===//
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@ -37,12 +37,35 @@ Macros:
*/
#include "third_party/libcxx/__config"
#include <__config>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
# pragma GCC system_header
#endif
#include "libc/isystem/limits.h"
#ifdef _LIBCPP_COMPILER_GCC
// GCC header limits.h recursively includes itself through another header called
// syslimits.h for some reason. This setup breaks down if we directly
// #include_next GCC's limits.h (reasons not entirely clear to me).
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107795 for more details.
// Therefore, we manually re-create the necessary include sequence below:
// Get the system limits.h defines (force recurse into the next level)
#define _GCC_LIMITS_H_
#define _GCC_NEXT_LIMITS_H
#include_next <limits.h>
// Get the ISO C defines
#undef _GCC_LIMITS_H_
#include_next <limits.h>
#else
# if __has_include_next(<limits.h>)
# include_next <limits.h>
# endif
#endif // _LIBCPP_COMPILER_GCC
#endif // _LIBCPP_LIMITS_H