Skip to content

Commit 198e5a9

Browse files
committed
integrated EASTL into the libcxx headers
1 parent c2918bb commit 198e5a9

Some content is hidden

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

42 files changed

+836
-252
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/include/__EASTL_user_config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
#define EASTL_THREAD_SUPPORT_AVAILABLE 0
6+
#define EASTL_EASTDC_VSNPRINTF 0
67

78

89
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) && !defined(SSIZE_T_DEFINED)

src/libcxx/header_test.cpp

Lines changed: 26 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>
@@ -10,6 +13,7 @@
1013
#include <ciso646>
1114
#include <climits>
1215
#include <cmath>
16+
#include <compare>
1317
#if __cplusplus >= 201907L
1418
#include <concepts>
1519
#endif // __cplusplus >= 201907L
@@ -21,21 +25,42 @@
2125
#include <cstdio>
2226
#include <cstdlib>
2327
#include <cstring>
24-
#include <ctime>
2528
#include <ctgmath>
29+
#include <ctime>
2630
#include <cxxabi.h>
31+
#include <deque>
2732
#include <exception>
33+
#include <expected>
34+
#include <functional>
2835
#include <initializer_list>
36+
#include <iterator>
2937
#include <limits>
38+
#include <list>
39+
#include <map>
3040
#include <memory>
3141
#include <new>
3242
#include <numbers>
43+
#include <numeric>
44+
#include <optional>
45+
#include <queue>
46+
#include <random>
47+
#include <ratio>
48+
#include <set>
3349
#if __cplusplus >= 201907L
3450
#include <source_location>
3551
#endif // __cplusplus >= 201907L
52+
#include <span>
53+
#include <stack>
54+
#include <string>
55+
#include <string_view>
56+
#include <tuple>
3657
#include <type_traits>
3758
#include <typeinfo>
59+
#include <unordered_map>
60+
#include <unordered_set>
3861
#include <utility>
62+
#include <variant>
63+
#include <vector>
3964
#include <version>
4065

4166
#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 & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,13 @@
11
// -*- C++ -*-
2-
//===----------------------------------------------------------------------===//
3-
//
4-
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5-
// See https://llvm.org/LICENSE.txt for license information.
6-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7-
//
8-
//===----------------------------------------------------------------------===//
9-
102
#ifndef _EZCXX_ALGORITHM
113
#define _EZCXX_ALGORITHM
124

13-
#include <__config>
14-
15-
// currently unused, but included in the standard
5+
#include <__eastl_config>
166
#include <initializer_list>
7+
#include <EASTL/algorithm.h>
8+
#include <EASTL/heap.h>
9+
#include <EASTL/sort.h>
1710

1811
#pragma clang system_header
1912

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-
6413
#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

src/libcxx/include/compare

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

src/libcxx/include/deque

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

0 commit comments

Comments
 (0)