Skip to content
Snippets Groups Projects
Commit 1759a85e authored by Stéphane Poirier's avatar Stéphane Poirier
Browse files

GNU atomic support with gcc >= 4.8.0

parent 71dbf656
No related branches found
No related tags found
No related merge requests found
......@@ -139,13 +139,18 @@ namespace yat
#undef YAT_HAS_ATOMIC
#if __GNUC__ >= 4
# if __GNUC__ == 4
# if __GNUC_MINOR__ >= 4
# define YAT_HAS_ATOMIC
# if __GNUC_MINOR__ >= 8
# define YAT_HAS_C11ATOMIC
# elif __GNUC_MINOR__ >= 4
# define YAT_HAS_CSTDATOMIC
# endif
# else
# define YAT_HAS_ATOMIC
# define YAT_HAS_C11ATOMIC
# endif
#endif
#if defined (YAT_HAS_C11ATOMIC) || defined (YAT_HAS_CSTDATOMIC)
# define YAT_HAS_ATOMIC
#endif
/**
......
......@@ -40,7 +40,11 @@
#ifndef _YAT_ATOMIC_H_
#define _YAT_ATOMIC_H_
#ifdef YAT_HAS_ATOMIC
#ifdef YAT_HAS_C11ATOMIC
#include <atomic>
#endif
#ifdef YAT_HAS_CSTDATOMIC
#include <cstdatomic>
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment