From 06d43760e4ca2cc7007e54d88938eff9e95e0579 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 6 Jun 2018 09:18:10 +0200 Subject: [PATCH] Restore _Atomic define before stdatomic.h for old gcc see #1593 --- common.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common.h b/common.h index 123e3dee7..ecf07316d 100644 --- a/common.h +++ b/common.h @@ -649,12 +649,21 @@ int omp_get_num_procs(void); __declspec(dllimport) int __cdecl omp_in_parallel(void); __declspec(dllimport) int __cdecl omp_get_num_procs(void); #endif + #if (__STDC_VERSION__ >= 201112L) +#if defined(C_GCC) && ( __GNUC__ < 7) +// workaround for GCC bug 65467 #ifndef _Atomic #define _Atomic volatile #endif -#include #endif +#include +#else +#ifndef _Atomic +#define _Atomic volatile +#endif + + #else #ifdef __ELF__ int omp_in_parallel (void) __attribute__ ((weak));