Skip to content

Commit 06d4376

Browse files
authored
Restore _Atomic define before stdatomic.h for old gcc
see #1593
1 parent f5959f2 commit 06d4376

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

common.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,12 +649,21 @@ int omp_get_num_procs(void);
649649
__declspec(dllimport) int __cdecl omp_in_parallel(void);
650650
__declspec(dllimport) int __cdecl omp_get_num_procs(void);
651651
#endif
652+
652653
#if (__STDC_VERSION__ >= 201112L)
654+
#if defined(C_GCC) && ( __GNUC__ < 7)
655+
// workaround for GCC bug 65467
653656
#ifndef _Atomic
654657
#define _Atomic volatile
655658
#endif
659+
#endif
656660
#include <stdatomic.h>
661+
#else
662+
#ifndef _Atomic
663+
#define _Atomic volatile
657664
#endif
665+
666+
658667
#else
659668
#ifdef __ELF__
660669
int omp_in_parallel (void) __attribute__ ((weak));

0 commit comments

Comments
 (0)