mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Add more missing C / C++ headers
This commit is contained in:
parent
b9dc74b672
commit
8dd4ec68d0
152 changed files with 30711 additions and 6267 deletions
20
third_party/libcxx/countof.internal.hh
vendored
Normal file
20
third_party/libcxx/countof.internal.hh
vendored
Normal 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_ */
|
Loading…
Add table
Add a link
Reference in a new issue