mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Upgrade to 2022-era LLVM LIBCXX
This commit is contained in:
parent
2f4ca71f26
commit
8e68384e15
2078 changed files with 165657 additions and 65010 deletions
132
third_party/libcxx/cstdlib
vendored
132
third_party/libcxx/cstdlib
vendored
|
@ -1,5 +1,5 @@
|
|||
// -*- C++ -*-
|
||||
//===--------------------------- cstdlib ----------------------------------===//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
|
@ -10,11 +10,6 @@
|
|||
#ifndef _LIBCPP_CSTDLIB
|
||||
#define _LIBCPP_CSTDLIB
|
||||
|
||||
#include "third_party/libcxx/__config"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/libcxx/stdlib.h"
|
||||
#include "libc/isystem/stdlib.h"
|
||||
|
||||
/*
|
||||
cstdlib synopsis
|
||||
|
||||
|
@ -86,80 +81,73 @@ void *aligned_alloc(size_t alignment, size_t size); // C11
|
|||
|
||||
*/
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
#pragma GCC system_header
|
||||
#include <__assert> // all public C++ headers provide the assertion handler
|
||||
#include <__config>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef _LIBCPP_STDLIB_H
|
||||
# error <cstdlib> tried including <stdlib.h> but didn't find libc++'s <stdlib.h> header. \
|
||||
This usually means that your header search paths are not configured properly. \
|
||||
The header search paths should contain the C++ Standard Library headers before \
|
||||
any C Standard Library, and you are probably using compiler flags that make that \
|
||||
not be the case.
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define _LIBCPP_UNREACHABLE() __builtin_unreachable()
|
||||
#else
|
||||
#define _LIBCPP_UNREACHABLE() _VSTD::abort()
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
using ::size_t;
|
||||
using ::div_t;
|
||||
using ::ldiv_t;
|
||||
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::lldiv_t;
|
||||
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::atof;
|
||||
using ::atoi;
|
||||
using ::atol;
|
||||
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::atoll;
|
||||
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::strtod;
|
||||
using ::strtof;
|
||||
using ::strtold;
|
||||
using ::strtol;
|
||||
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::strtoll;
|
||||
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::strtoul;
|
||||
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::strtoull;
|
||||
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::rand;
|
||||
using ::srand;
|
||||
using ::calloc;
|
||||
using ::free;
|
||||
using ::malloc;
|
||||
using ::realloc;
|
||||
using ::abort;
|
||||
using ::atexit;
|
||||
using ::exit;
|
||||
using ::_Exit;
|
||||
#ifndef _LIBCPP_WINDOWS_STORE_APP
|
||||
using ::getenv;
|
||||
using ::system;
|
||||
using ::size_t _LIBCPP_USING_IF_EXISTS;
|
||||
using ::div_t _LIBCPP_USING_IF_EXISTS;
|
||||
using ::ldiv_t _LIBCPP_USING_IF_EXISTS;
|
||||
using ::lldiv_t _LIBCPP_USING_IF_EXISTS;
|
||||
using ::atof _LIBCPP_USING_IF_EXISTS;
|
||||
using ::atoi _LIBCPP_USING_IF_EXISTS;
|
||||
using ::atol _LIBCPP_USING_IF_EXISTS;
|
||||
using ::atoll _LIBCPP_USING_IF_EXISTS;
|
||||
using ::strtod _LIBCPP_USING_IF_EXISTS;
|
||||
using ::strtof _LIBCPP_USING_IF_EXISTS;
|
||||
using ::strtold _LIBCPP_USING_IF_EXISTS;
|
||||
using ::strtol _LIBCPP_USING_IF_EXISTS;
|
||||
using ::strtoll _LIBCPP_USING_IF_EXISTS;
|
||||
using ::strtoul _LIBCPP_USING_IF_EXISTS;
|
||||
using ::strtoull _LIBCPP_USING_IF_EXISTS;
|
||||
using ::rand _LIBCPP_USING_IF_EXISTS;
|
||||
using ::srand _LIBCPP_USING_IF_EXISTS;
|
||||
using ::calloc _LIBCPP_USING_IF_EXISTS;
|
||||
using ::free _LIBCPP_USING_IF_EXISTS;
|
||||
using ::malloc _LIBCPP_USING_IF_EXISTS;
|
||||
using ::realloc _LIBCPP_USING_IF_EXISTS;
|
||||
using ::abort _LIBCPP_USING_IF_EXISTS;
|
||||
using ::atexit _LIBCPP_USING_IF_EXISTS;
|
||||
using ::exit _LIBCPP_USING_IF_EXISTS;
|
||||
using ::_Exit _LIBCPP_USING_IF_EXISTS;
|
||||
using ::getenv _LIBCPP_USING_IF_EXISTS;
|
||||
using ::system _LIBCPP_USING_IF_EXISTS;
|
||||
using ::bsearch _LIBCPP_USING_IF_EXISTS;
|
||||
using ::qsort _LIBCPP_USING_IF_EXISTS;
|
||||
using ::abs _LIBCPP_USING_IF_EXISTS;
|
||||
using ::labs _LIBCPP_USING_IF_EXISTS;
|
||||
using ::llabs _LIBCPP_USING_IF_EXISTS;
|
||||
using ::div _LIBCPP_USING_IF_EXISTS;
|
||||
using ::ldiv _LIBCPP_USING_IF_EXISTS;
|
||||
using ::lldiv _LIBCPP_USING_IF_EXISTS;
|
||||
using ::mblen _LIBCPP_USING_IF_EXISTS;
|
||||
using ::mbtowc _LIBCPP_USING_IF_EXISTS;
|
||||
using ::wctomb _LIBCPP_USING_IF_EXISTS;
|
||||
using ::mbstowcs _LIBCPP_USING_IF_EXISTS;
|
||||
using ::wcstombs _LIBCPP_USING_IF_EXISTS;
|
||||
#if !defined(_LIBCPP_CXX03_LANG)
|
||||
using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
|
||||
using ::quick_exit _LIBCPP_USING_IF_EXISTS;
|
||||
#endif
|
||||
using ::bsearch;
|
||||
using ::qsort;
|
||||
using ::abs;
|
||||
using ::labs;
|
||||
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::llabs;
|
||||
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::div;
|
||||
using ::ldiv;
|
||||
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::lldiv;
|
||||
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||
using ::mblen;
|
||||
using ::mbtowc;
|
||||
using ::wctomb;
|
||||
using ::mbstowcs;
|
||||
using ::wcstombs;
|
||||
#if !defined(_LIBCPP_CXX03_LANG) && defined(_LIBCPP_HAS_QUICK_EXIT)
|
||||
using ::at_quick_exit;
|
||||
using ::quick_exit;
|
||||
#endif
|
||||
#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES)
|
||||
using ::aligned_alloc;
|
||||
#if _LIBCPP_STD_VER >= 17
|
||||
using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_CSTDLIB
|
||||
#endif // _LIBCPP_CSTDLIB
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue