Add more missing C / C++ headers

This commit is contained in:
Justine Tunney 2022-09-04 04:53:52 -07:00
parent b9dc74b672
commit 8dd4ec68d0
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
152 changed files with 30711 additions and 6267 deletions

20
third_party/libcxx/countof.internal.hh vendored Normal file
View file

@ -0,0 +1,20 @@
#ifndef COSMOPOLITAN_THIRD_PARTY_LIBCXX_COUNTOF_H_
#define COSMOPOLITAN_THIRD_PARTY_LIBCXX_COUNTOF_H_
#include "third_party/libcxx/__config"
namespace {
template <typename T, size_t N>
inline _LIBCPP_CONSTEXPR size_t countof(const T (&)[N]) {
return N;
}
template <typename T>
inline _LIBCPP_CONSTEXPR size_t countof(const T* const begin,
const T* const end) {
return static_cast<size_t>(end - begin);
}
} // namespace
#endif /* COSMOPOLITAN_THIRD_PARTY_LIBCXX_COUNTOF_H_ */