error: ‘_Atomic’ does not name a type
Question
/aarch64-os-linux/gcc/aarch64-os-linux/11.3.0/include/stdatomic.h:40:9: error: ‘_Atomic’ does not name a type
40 | typedef _Atomic \_Bool atomic_bool;
Answer
#ifdef __cplusplus
#include <atomic>
using namespace std;
#else
#include <stdatomic.h>
#endif
#ifndef __cplusplus
# include <stdatomic.h>
#else
# include <atomic>
# define _Atomic(X) std::atomic< X >
#endif