mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-08-03 02:06:05 -04:00
Made atomics check work with old compilers
In our CI a quite old version of gcc (6.3.0) is used for the aarch64 configs and it was confused by the (previous) code of the test program intended to find out if libatomics must be explicitly passed to the linker.
This commit is contained in:
parent
a0c99f879b
commit
b7421d7dae
@ -22,11 +22,11 @@ atomics_program = '''
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
volatile atomic_bool a_b = true;
|
volatile atomic_bool a_b(true);
|
||||||
volatile atomic_ullong a_ull = -1;
|
volatile atomic_ullong a_ull(-1);
|
||||||
// Next two lines are to cover atomic<socket_t> from 'httplib.h'.
|
// Next two lines are to cover atomic<socket_t> from 'httplib.h'.
|
||||||
volatile atomic<uint32_t> a_u32 = -1;
|
volatile atomic<uint32_t> a_u32(-1);
|
||||||
volatile atomic<uint64_t> a_u64 = -1;
|
volatile atomic<uint64_t> a_u64(-1);
|
||||||
|
|
||||||
return atomic_load(&a_b) == false && atomic_load(&a_ull) == 0 &&
|
return atomic_load(&a_b) == false && atomic_load(&a_ull) == 0 &&
|
||||||
atomic_load(&a_u32) == 0 && atomic_load(&a_u64) == 0;
|
atomic_load(&a_u32) == 0 && atomic_load(&a_u64) == 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user