llvm-project/libcxx/include
Eric Fiselier 82b47b2978 [libc++] Move abs and div into stdlib.h to fix header cycle.
libc++ is careful to not fracture overload sets. When one overload
is visible to a user, all of them should be. Anything less causes
subtle bugs and ODR violations.

Previously, in order to support ::abs and ::div being supplied by
both <cmath> and <cstdlib> we had to do awful things that make
<math.h> and <stdlib.h> have header cycles and be non-modular.
This really breaks with modules.

Specifically the problem was that in C++ ::abs introduces overloads
for floating point numbers, these overloads forward to ::fabs,
which are defined in math.h. Therefore ::abs needed to be in math.h
too. But this required stdlib.h to include math.h and math.h to
include stdlib.h.

To avoid these problems the definitions have been moved to stddef.h
(which math includes), and the floating point overloads of ::abs
have been changed to call __builtin_fabs, which both Clang and GCC
support.
2020-02-15 18:55:07 -05:00
..
experimental [NFC] Strip trailing whitespace from libc++ 2019-10-23 11:19:19 -07:00
ext [libc++] Cleanup and enable multiple warnings. 2019-12-12 21:09:08 -05:00
support [libcxx] [Windows] Store the lconv struct returned from localeconv in locale_t 2020-01-29 22:37:11 +02:00
CMakeLists.txt [NFC] Fix typos in CMake comment 2019-10-21 23:38:32 +00:00
__bit_reference [libc++] Cleanup and enable multiple warnings. 2019-12-12 21:09:08 -05:00
__bsd_locale_defaults.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__bsd_locale_fallbacks.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__config Define _LIBCPP_HAS_TIMESPEC_GET for FreeBSD when appropriate 2020-01-30 08:00:56 +01:00
__config_site.in [libc++] Take 2: Integrate the PSTL into libc++ 2019-08-05 18:29:14 +00:00
__debug [libc++][NFC] Remove excess trailing newlines from most files 2019-10-23 08:08:57 -07:00
__errc Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__functional_03 [libc++] Rework compressed pair constructors. 2019-12-16 18:38:58 -05:00
__functional_base [libc++] Take 2: Implement LWG 2510 2019-09-26 14:51:10 +00:00
__functional_base_03 Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__hash_table [libc++] Rework compressed pair constructors. 2019-12-16 18:38:58 -05:00
__libcpp_version Bump the trunk major version to 11 2020-01-15 13:38:01 +01:00
__locale [libcxx] Fix build breakage on mips 2019-08-20 10:19:55 +00:00
__mutex_base [libc++] Ensure __config always defines certain configuration macros. 2019-12-13 15:42:07 -05:00
__node_handle Avoid name conflict with kernel headers 2019-04-24 09:43:44 +00:00
__nullptr Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__split_buffer [libc++] Rework compressed pair constructors. 2019-12-16 18:38:58 -05:00
__sso_allocator Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__std_stream Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__string [libc++] Explicitly enumerate std::string external instantiations - Attempt 2 2020-01-15 17:12:49 -05:00
__threading_support [libcxx] Use mtx_plain | mtx_recursive following C11 API 2020-01-15 15:15:39 -08:00
__tree [libc++] Rework compressed pair constructors. 2019-12-16 18:38:58 -05:00
__tuple Refactor default constructor SFINAE in pair and tuple. 2019-09-30 20:55:30 +00:00
__undef_macros Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
algorithm Rename __is_foo_iterator traits to reflect their Cpp17 nature. 2019-11-18 01:49:32 -05:00
any [NFC][libc++] Remove stray semi-colon after function definition 2019-06-19 16:33:28 +00:00
array Reland [libc++] [P0325] Implement to_array from LFTS with updates. 2020-01-31 11:47:18 +01:00
atomic [libc++] Use __extension__ in a portable manner 2019-09-04 12:44:19 +00:00
bit [NFC] Strip trailing whitespace from libc++ 2019-10-23 11:19:19 -07:00
bitset Ensure bitset's string constructor doesn't poison the overload set. 2019-07-01 19:59:34 +00:00
cassert Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ccomplex Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cctype Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cerrno Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cfenv Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cfloat Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
charconv [libc++] Fix build with gcc 4.8 2019-06-13 22:27:24 +00:00
chrono [libc++] [chrono] Fix year_month_weekday::ok() implementation. 2019-11-15 18:48:45 +01:00
cinttypes Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ciso646 Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
climits Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
clocale Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cmath [libc++] Harden usage of static_assert against C++03 2019-10-01 12:12:21 +00:00
codecvt Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
compare Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
complex [NFC][libcxx] Remove trailing whitespace 2019-05-29 16:01:36 +00:00
complex.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
condition_variable Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
csetjmp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
csignal Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cstdarg Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cstdbool Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cstddef [libc++] Remove cycle between <type_traits> and <cstddef> 2020-02-14 17:36:27 +01:00
cstdint Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cstdio Remove ::gets for FreeBSD 13 and later 2019-09-07 22:18:20 +00:00
cstdlib Fix _LIBCPP_HAS_ definitions for Android. 2019-11-18 12:19:58 -08:00
cstring Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ctgmath Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ctime Fix _LIBCPP_HAS_ definitions for Android. 2019-11-18 12:19:58 -08:00
ctype.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cwchar Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cwctype Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
deque [libc++] Rework compressed pair constructors. 2019-12-16 18:38:58 -05:00
errno.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
exception Make move and forward work in C++03. 2019-06-21 15:20:55 +00:00
execution [pstl][libc++] Provide uglified header names for interface headers 2019-08-06 21:11:24 +00:00
fenv.h Mark fenv.h as a system header before the #include_next directive 2019-03-29 16:03:57 +00:00
filesystem Rename __is_foo_iterator traits to reflect their Cpp17 nature. 2019-11-18 01:49:32 -05:00
float.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
forward_list [libc++] Rework compressed pair constructors. 2019-12-16 18:38:58 -05:00
fstream Open fstream files in O_CLOEXEC mode when possible. 2019-09-16 19:26:41 +00:00
functional Revert "Suppress -Wctad-maybe-unsupported on types w/o deduction guides." 2019-08-04 07:13:43 +00:00
future [libc++] Rework compressed pair constructors. 2019-12-16 18:38:58 -05:00
initializer_list [NFC][libcxx] Remove trailing whitespace 2019-05-29 16:01:36 +00:00
inttypes.h AIX system headers need stdint.h and inttypes.h to be re-enterable 2019-06-20 15:36:32 +00:00
iomanip [NFC][libcxx] Remove trailing whitespace 2019-05-29 16:01:36 +00:00
ios [NFC][libcxx] Remove trailing whitespace 2019-05-29 16:01:36 +00:00
iosfwd Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
iostream Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
istream [libc++] Implement LWG 3199 2019-08-20 18:21:06 +00:00
iterator Rename __is_foo_iterator traits to reflect their Cpp17 nature. 2019-11-18 01:49:32 -05:00
limits Fix -Wdouble-promotion warnings. 2019-07-01 16:13:31 +00:00
limits.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
list [libc++] Rework compressed pair constructors. 2019-12-16 18:38:58 -05:00
locale [NFC][libcxx] Remove trailing whitespace 2019-05-29 16:01:36 +00:00
locale.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
map [libc++] Use _EnableIf instead of std::enable_if in deduction guides for map and set 2019-07-19 17:13:39 +00:00
math.h [libc++] Move abs and div into stdlib.h to fix header cycle. 2020-02-15 18:55:07 -05:00
memory [libc++] Make sure that vector copy-construction is disabled for non-copyable types 2020-02-11 17:12:16 +01:00
module.modulemap [libc++] Take 2: Integrate the PSTL into libc++ 2019-08-05 18:29:14 +00:00
mutex [libc++] Mark __call_once_proxy as hidden and internal 2019-11-11 10:27:48 -05:00
new [libc++] Take 2: Implement LWG 2510 2019-09-26 14:51:10 +00:00
numeric [libc++] Fix typo in std::midpoint 2019-12-21 01:26:24 -08:00
optional Add a missing '__uncvref_t' to the SFINAE constraints for optional's assignment operator. Fixes PR38638. Thanks to Jonathan Wakely for the report 2019-06-27 18:40:55 +00:00
ostream Add forward declaration of operator<< in <string_view> as required. 2019-09-25 18:56:54 +00:00
queue Rename __is_foo_iterator traits to reflect their Cpp17 nature. 2019-11-18 01:49:32 -05:00
random [libc++] Cleanup and enable multiple warnings. 2019-12-12 21:09:08 -05:00
ratio Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
regex Rename __is_foo_iterator traits to reflect their Cpp17 nature. 2019-11-18 01:49:32 -05:00
scoped_allocator Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
set [libc++] Use _EnableIf instead of std::enable_if in deduction guides for map and set 2019-07-19 17:13:39 +00:00
setjmp.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
shared_mutex Revert "Suppress -Wctad-maybe-unsupported on types w/o deduction guides." 2019-08-04 07:13:43 +00:00
span [libc++] span: Fix incorrect static asserts 2020-02-14 14:32:41 +01:00
sstream add a test and a couple minor bug fixes for the implicit-signed-integer-truncation sanitizer. This is PR#40566 2019-02-01 21:59:27 +00:00
stack [NFC][libcxx] Remove trailing whitespace 2019-05-29 16:01:36 +00:00
stdbool.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
stddef.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
stdexcept Fix ABI compatibility of `<stdexcept>` with VCRuntime. 2019-03-06 20:31:57 +00:00
stdint.h AIX system headers need stdint.h and inttypes.h to be re-enterable 2019-06-20 15:36:32 +00:00
stdio.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
stdlib.h [libc++] Move abs and div into stdlib.h to fix header cycle. 2020-02-15 18:55:07 -05:00
streambuf Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
string White space only change: reflow a comment in basic_string 2020-01-30 19:55:48 -05:00
string.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
string_view Add forward declaration of operator<< in <string_view> as required. 2019-09-25 18:56:54 +00:00
strstream Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
system_error Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
tgmath.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
thread [libc++] Hide some functions and types in <future> and <thread> as hidden 2019-12-10 19:19:45 -05:00
tuple PR43764: Qualify a couple of calls to forward_as_tuple to be ADL-resilient. 2019-10-28 18:04:41 -07:00
type_traits [libc++] Remove cycle between <type_traits> and <cstddef> 2020-02-14 17:36:27 +01:00
typeindex Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
typeinfo add type_traits include as required for std::integral_constant 2020-02-14 16:38:28 +01:00
unordered_map Add contains method to associative containers. This patch implements P0458R2, adding contains to map, multimap, unordered_map, unordered_multimap, set, multiset, unordered_set, and unordered_multiset. 2019-07-16 03:21:01 +00:00
unordered_set Add contains method to associative containers. This patch implements P0458R2, adding contains to map, multimap, unordered_map, unordered_multimap, set, multiset, unordered_set, and unordered_multiset. 2019-07-16 03:21:01 +00:00
utility Refactor default constructor SFINAE in pair and tuple. 2019-09-30 20:55:30 +00:00
valarray [libc++] Cleanup and enable multiple warnings. 2019-12-12 21:09:08 -05:00
variant Improve compile time of variant. 2019-07-14 21:29:39 +00:00
vector [libcxx] Qualify make_move_iterator in vector::insert for input iterators 2020-02-11 11:00:45 +01:00
version Reland [libc++] [P0325] Implement to_array from LFTS with updates. 2020-01-31 11:47:18 +01:00
wchar.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
wctype.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00