Skip to content

Commit d6e63b5

Browse files
committed
Old Clang and GCC
1 parent fe929f4 commit d6e63b5

3 files changed

Lines changed: 41 additions & 26 deletions

File tree

.github/workflows/clang.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,31 @@ jobs:
1212
include:
1313

1414
# x64
15-
- clang_ver: '3.9'
15+
- clang_ver: '3.8'
1616
ubuntu_ver: '24.04'
1717
build_type: 'Release'
1818
test_libcxx20: 'Off'
1919
no_exceptions_rtti: 'Off'
2020
extra_settings: 'Off'
21-
flags: '-std=c++11 -Werror'
21+
flags: '-std=c++11 -Werror -DMOMO_TEST_HAS_NO_ENUM_HASH'
2222
cont_ver: '18.04'
2323

24-
- clang_ver: '3.9'
24+
- clang_ver: '3.8'
2525
ubuntu_ver: '24.04'
2626
build_type: 'Release'
2727
test_libcxx20: 'Off'
2828
no_exceptions_rtti: 'On'
2929
extra_settings: 'Off'
30-
flags: '-std=c++11 -Werror'
30+
flags: '-std=c++11 -Werror -DMOMO_TEST_HAS_NO_ENUM_HASH'
3131
cont_ver: '18.04'
3232

33-
- clang_ver: '3.9'
33+
- clang_ver: '3.8'
3434
ubuntu_ver: '24.04'
3535
build_type: 'Release'
3636
test_libcxx20: 'Off'
3737
no_exceptions_rtti: 'Off'
3838
extra_settings: 'On'
39-
flags: '-std=c++11 -Werror'
39+
flags: '-std=c++11 -Werror -DMOMO_TEST_HAS_NO_ENUM_HASH'
4040
cont_ver: '18.04'
4141

4242
- clang_ver: '3.9'
@@ -247,31 +247,31 @@ jobs:
247247
cont_ver: '24.04'
248248

249249
# ARM64
250-
- clang_ver: '3.9'
250+
- clang_ver: '3.8'
251251
ubuntu_ver: '24.04-arm'
252252
build_type: 'Release'
253253
test_libcxx20: 'Off'
254254
no_exceptions_rtti: 'Off'
255255
extra_settings: 'Off'
256-
flags: '-std=c++11 -Werror'
256+
flags: '-std=c++11 -Werror -DMOMO_TEST_HAS_NO_ENUM_HASH'
257257
cont_ver: '18.04'
258258

259-
- clang_ver: '3.9'
259+
- clang_ver: '3.8'
260260
ubuntu_ver: '24.04-arm'
261261
build_type: 'Release'
262262
test_libcxx20: 'Off'
263263
no_exceptions_rtti: 'On'
264264
extra_settings: 'Off'
265-
flags: '-std=c++11 -Werror'
265+
flags: '-std=c++11 -Werror -DMOMO_TEST_HAS_NO_ENUM_HASH'
266266
cont_ver: '18.04'
267267

268-
- clang_ver: '3.9'
268+
- clang_ver: '3.8'
269269
ubuntu_ver: '24.04-arm'
270270
build_type: 'Release'
271271
test_libcxx20: 'Off'
272272
no_exceptions_rtti: 'Off'
273273
extra_settings: 'On'
274-
flags: '-std=c++11 -Werror'
274+
flags: '-std=c++11 -Werror -DMOMO_TEST_HAS_NO_ENUM_HASH'
275275
cont_ver: '18.04'
276276

277277
- clang_ver: '3.9'
@@ -491,15 +491,19 @@ jobs:
491491
apt-get install -y cmake
492492
apt-get install -y ninja-build
493493
apt-get install -y g++
494+
- name: Prepare Xenial
495+
if: matrix.ubuntu_ver == '18.04'
496+
run: |
497+
echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main universe" | tee -a /etc/apt/sources.list
498+
apt-get update
494499
- name: Checkout
495500
if: matrix.cont_ver != '18.04'
496501
uses: actions/checkout@v6
497502
- name: Checkout 18.04
498503
if: matrix.cont_ver == '18.04'
499-
# Checkout branch_cpp11
500504
run: |
501505
apt-get install -y git
502-
git clone --depth=1 https://github.com/${{ github.repository }} .
506+
git clone --depth=1 --single-branch --branch ${{ github.ref_name }} https://github.com/${{ github.repository }} .
503507
- name: Install Clang
504508
run: apt-get install -y clang-${{ matrix.clang_ver }}
505509
- name: Build

.github/workflows/gcc.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
test_libcxx20: 'Off'
1919
no_exceptions_rtti: 'Off'
2020
extra_settings: 'Off'
21-
flags: '-std=c++11 -Werror -Wno-unused-variable'
21+
flags: '-std=c++11 -Werror -Wno-unused-variable -DMOMO_TEST_HAS_NO_ENUM_HASH'
2222
cont_ver: '18.04'
2323

2424
- gcc_ver: '5'
@@ -27,7 +27,7 @@ jobs:
2727
test_libcxx20: 'Off'
2828
no_exceptions_rtti: 'On'
2929
extra_settings: 'Off'
30-
flags: '-std=c++11 -Werror -Wno-unused-variable'
30+
flags: '-std=c++11 -Werror -Wno-unused-variable -DMOMO_TEST_HAS_NO_ENUM_HASH'
3131
cont_ver: '18.04'
3232

3333
- gcc_ver: '5'
@@ -36,7 +36,7 @@ jobs:
3636
test_libcxx20: 'Off'
3737
no_exceptions_rtti: 'Off'
3838
extra_settings: 'On'
39-
flags: '-std=c++11 -Werror -Wno-unused-variable'
39+
flags: '-std=c++11 -Werror -Wno-unused-variable -DMOMO_TEST_HAS_NO_ENUM_HASH'
4040
cont_ver: '18.04'
4141

4242
- gcc_ver: '5'
@@ -45,7 +45,7 @@ jobs:
4545
test_libcxx20: 'Off'
4646
no_exceptions_rtti: 'Off'
4747
extra_settings: 'Off'
48-
flags: '-std=c++14 -Werror -Wno-unused-variable'
48+
flags: '-std=c++14 -Werror -Wno-unused-variable -DMOMO_TEST_HAS_NO_ENUM_HASH'
4949
cont_ver: '18.04'
5050

5151
- gcc_ver: '6'
@@ -199,7 +199,7 @@ jobs:
199199
test_libcxx20: 'Off'
200200
no_exceptions_rtti: 'Off'
201201
extra_settings: 'Off'
202-
flags: '-std=c++11 -Werror -Wno-unused-variable'
202+
flags: '-std=c++11 -Werror -Wno-unused-variable -DMOMO_TEST_HAS_NO_ENUM_HASH'
203203
cont_ver: '18.04'
204204

205205
- gcc_ver: '5'
@@ -208,7 +208,7 @@ jobs:
208208
test_libcxx20: 'Off'
209209
no_exceptions_rtti: 'On'
210210
extra_settings: 'Off'
211-
flags: '-std=c++11 -Werror -Wno-unused-variable'
211+
flags: '-std=c++11 -Werror -Wno-unused-variable -DMOMO_TEST_HAS_NO_ENUM_HASH'
212212
cont_ver: '18.04'
213213

214214
- gcc_ver: '5'
@@ -217,7 +217,7 @@ jobs:
217217
test_libcxx20: 'Off'
218218
no_exceptions_rtti: 'Off'
219219
extra_settings: 'On'
220-
flags: '-std=c++11 -Werror -Wno-unused-variable'
220+
flags: '-std=c++11 -Werror -Wno-unused-variable -DMOMO_TEST_HAS_NO_ENUM_HASH'
221221
cont_ver: '18.04'
222222

223223
- gcc_ver: '5'
@@ -226,7 +226,7 @@ jobs:
226226
test_libcxx20: 'Off'
227227
no_exceptions_rtti: 'Off'
228228
extra_settings: 'Off'
229-
flags: '-std=c++14 -Werror -Wno-unused-variable'
229+
flags: '-std=c++14 -Werror -Wno-unused-variable -DMOMO_TEST_HAS_NO_ENUM_HASH'
230230
cont_ver: '18.04'
231231

232232
- gcc_ver: '6'
@@ -387,10 +387,9 @@ jobs:
387387
uses: actions/checkout@v6
388388
- name: Checkout 18.04
389389
if: matrix.cont_ver == '18.04'
390-
# Checkout branch_cpp11
391390
run: |
392391
apt-get install -y git
393-
git clone --depth=1 https://github.com/${{ github.repository }} .
392+
git clone --depth=1 --single-branch --branch ${{ github.ref_name }} https://github.com/${{ github.repository }} .
394393
- name: Install GCC
395394
run: apt-get install -y g++-${{ matrix.gcc_ver }}
396395
- name: Build

test/sources/SimpleDataTester.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@
2121
#include <iostream>
2222
#include <sstream>
2323

24+
#ifdef MOMO_TEST_HAS_NO_ENUM_HASH
25+
namespace momo
26+
{
27+
template<>
28+
struct HashCoder<DataColumnCodeOffset, size_t>
29+
{
30+
size_t operator()(const DataColumnCodeOffset& key) const noexcept
31+
{
32+
return HashCoder<size_t>()(static_cast<size_t>(key));
33+
}
34+
};
35+
}
36+
#endif
37+
2438
namespace
2539
{
2640
typedef momo::DataStructDefault<int, double, std::string> BaseStruct;
@@ -104,7 +118,6 @@ class SimpleDataTester
104118
std::cout << "ok" << std::endl;
105119
}
106120

107-
#if !(defined(TEST_GCC) && __GNUC__ < 6) // std::hash<enum class>
108121
{
109122
std::cout << "momo::DataColumnList (struct, -RowNumber): " << std::flush;
110123
typedef momo::DataColumnList<momo::DataColumnTraits<Struct, 4>,
@@ -115,7 +128,6 @@ class SimpleDataTester
115128
TestData<true>(table, intStruct, dblStruct, strStruct);
116129
std::cout << "ok" << std::endl;
117130
}
118-
#endif
119131

120132
{
121133
std::cout << "momo::DataColumnList (string, +RowNumber): " << std::flush;

0 commit comments

Comments
 (0)