Skip to content

Commit fb5acad

Browse files
ixgbe00charris
authored andcommitted
BUG:fix compile error libatomic link test to meson.build
1 parent de6597f commit fb5acad

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

numpy/meson.build

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,19 @@ null_dep = dependency('', required : false)
223223
atomic_dep = null_dep
224224
code_non_lockfree = '''
225225
#include <stdint.h>
226+
#include <stddef.h>
227+
#include <stdatomic.h>
226228
int main() {
227229
struct {
228230
void *p;
229231
uint8_t u8v;
230232
} x;
231233
x.p = NULL;
232234
x.u8v = 0;
233-
uint8_t res = __atomic_load_n(x.u8v, __ATOMIC_SEQ_CST);
234-
__atomic_store_n(x.u8v, 1, ATOMIC_SEQ_CST);
235-
void *p = __atomic_load_n(x.p, __ATOMIC_SEQ_CST);
236-
__atomic_store_n((void **)x.p, NULL, __ATOMIC_SEQ_CST)
235+
uint8_t res = __atomic_load_n(&x.u8v, __ATOMIC_SEQ_CST);
236+
__atomic_store_n(&x.u8v, 1, __ATOMIC_SEQ_CST);
237+
void *p = __atomic_load_n((void **)x.p, __ATOMIC_SEQ_CST);
238+
__atomic_store_n((void **)x.p, NULL, __ATOMIC_SEQ_CST);
237239
return 0;
238240
}
239241
'''

0 commit comments

Comments
 (0)