Skip to content

Commit 8448ba3

Browse files
committed
integrated EASTL into the libcxx headers
1 parent c82098e commit 8448ba3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+666
-58
lines changed

.gitmodules

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
url = https://github.com/CE-Programming/graphx-template
2121
[submodule "src/EASTL"]
2222
path = src/ea/EASTL
23-
url = https://github.com/electronicarts/EASTL.git
23+
url = https://github.com/CE-Programming/EASTL.git
24+
branch = eastl-tice
2425
[submodule "src/EABase"]
2526
path = src/ea/EABase
26-
url = https://github.com/electronicarts/EABase.git
27+
url = https://github.com/CE-Programming/EABase.git
28+
branch = eastl-tice

src/ea/EASTL

Submodule EASTL updated 193 files

src/ea/makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ EZCFLAGS += -DEASTL_USER_CONFIG_HEADER="<__EASTL_user_config.h>"
2626
EZCXXFLAGS := $(EZCFLAGS) -fno-exceptions -fno-rtti -fno-use-cxa-atexit
2727
EZCXXFLAGS += -isystem ../libcxx/include -isystem EABase/include/Common -isystem EASTL/include -isystem include
2828

29+
EZCFLAGS += -std=c17
30+
EZCXXFLAGS += -std=c++20
31+
2932
CONFIG_H = include/__EASTL_user_config.h
3033

3134
WILDCARD_SRC = $(wildcard *.src) $(BUILD_SRC)

src/libcxx/header_test.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#include <__config>
2+
#include <any>
23
#include <algorithm>
4+
#include <array>
35
#include <bit>
6+
#include <bitset>
47
#include <cassert>
58
#include <cctype>
69
#include <cerrno>
@@ -9,6 +12,7 @@
912
#include <ciso646>
1013
#include <climits>
1114
#include <cmath>
15+
#include <compare>
1216
#if __cplusplus >= 201907L
1317
#include <concepts>
1418
#endif // __cplusplus >= 201907L
@@ -20,21 +24,41 @@
2024
#include <cstdio>
2125
#include <cstdlib>
2226
#include <cstring>
23-
#include <ctime>
2427
#include <ctgmath>
28+
#include <ctime>
2529
#include <cxxabi.h>
30+
#include <deque>
2631
#include <exception>
32+
#include <functional>
2733
#include <initializer_list>
34+
#include <iterator>
2835
#include <limits>
36+
#include <list>
37+
#include <map>
2938
#include <memory>
3039
#include <new>
3140
#include <numbers>
41+
#include <numeric>
42+
#include <optional>
43+
#include <queue>
44+
#include <random>
45+
#include <ratio>
46+
#include <set>
3247
#if __cplusplus >= 201907L
3348
#include <source_location>
3449
#endif // __cplusplus >= 201907L
50+
#include <span>
51+
#include <stack>
52+
#include <string>
53+
#include <string_view>
54+
#include <tuple>
3555
#include <type_traits>
3656
#include <typeinfo>
57+
#include <unordered_map>
58+
#include <unordered_set>
3759
#include <utility>
60+
#include <variant>
61+
#include <vector>
3862
#include <version>
3963

4064
#include <alloca.h>

src/libcxx/include/__eastl_config

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef _EZCXX_EASTL_CONFIG
2+
#define _EZCXX_EASTL_CONFIG
3+
4+
#include <__config>
5+
6+
#pragma clang system_header
7+
8+
namespace eastl {
9+
10+
}
11+
12+
namespace std {
13+
using namespace eastl;
14+
}
15+
16+
#endif /* _EZCXX_EASTL_CONFIG */

src/libcxx/include/algorithm

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,55 +10,12 @@
1010
#ifndef _EZCXX_ALGORITHM
1111
#define _EZCXX_ALGORITHM
1212

13-
#include <__config>
14-
15-
// currently unused, but included in the standard
13+
#include <__eastl_config>
1614
#include <initializer_list>
15+
#include <EASTL/algorithm.h>
16+
#include <EASTL/heap.h>
17+
#include <EASTL/sort.h>
1718

1819
#pragma clang system_header
1920

20-
// very limited implementation of <algorithm>
21-
// only supports std:max, std::min, and std::clamp
22-
// these functions can be replaced when <algorithm> is properly implemented
23-
24-
namespace std {
25-
26-
template <class _Tp, class _Compare> _EZCXX_NODISCARD_EXT inline constexpr
27-
const _Tp& max(const _Tp& __a, const _Tp& __b, _Compare __comp)
28-
{
29-
return __comp(__a, __b) ? __b : __a;
30-
}
31-
32-
template <class _Tp> _EZCXX_NODISCARD_EXT inline constexpr
33-
const _Tp& max(const _Tp& __a, const _Tp& __b)
34-
{
35-
return (__a < __b) ? __b : __a;
36-
}
37-
38-
template <class _Tp, class _Compare> _EZCXX_NODISCARD_EXT inline constexpr
39-
const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp)
40-
{
41-
return __comp(__a, __b) ? __a : __b;
42-
}
43-
44-
template <class _Tp> _EZCXX_NODISCARD_EXT inline constexpr
45-
const _Tp& min(const _Tp& __a, const _Tp& __b)
46-
{
47-
return (__a < __b) ? __a : __b;
48-
}
49-
50-
template <class _Tp, class _Compare> _EZCXX_NODISCARD_EXT inline constexpr
51-
const _Tp& clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp)
52-
{
53-
return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v;
54-
}
55-
56-
template <class _Tp> _EZCXX_NODISCARD_EXT inline constexpr
57-
const _Tp& clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)
58-
{
59-
return (__v < __lo) ? __lo : (__hi < __v) ? __hi : __v;
60-
}
61-
62-
} // namespace std
63-
6421
#endif // _EZCXX_ALGORITHM

src/libcxx/include/any

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// -*- C++ -*-
2+
#ifndef _EZCXX_ANY
3+
#define _EZCXX_ANY
4+
5+
#include <__eastl_config>
6+
#include <algorithm>
7+
#include <EASTL/any.h>
8+
9+
#pragma clang system_header
10+
11+
#endif // _EZCXX_ANY

src/libcxx/include/array

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// -*- C++ -*-
2+
#ifndef _EZCXX_ARRAY
3+
#define _EZCXX_ARRAY
4+
5+
#include <__eastl_config>
6+
#include <initializer_list>
7+
#include <EASTL/array.h>
8+
9+
#pragma clang system_header
10+
11+
#endif // _EZCXX_ARRAY

src/libcxx/include/bitset

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// -*- C++ -*-
2+
#ifndef _EZCXX_BITSET
3+
#define _EZCXX_BITSET
4+
5+
#include <__eastl_config>
6+
#include <string>
7+
#include <EASTL/bitset.h>
8+
9+
#pragma clang system_header
10+
11+
#endif // _EZCXX_BITSET

0 commit comments

Comments
 (0)