-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,7 @@ if(CMAKE_USE_PTHREADS_INIT) | |
endif() | ||
|
||
add_definitions( | ||
-DHAVE_ATOMIC | ||
-DHAVE_INET6 | ||
-DHAVE_SELECT | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* @file re_atomic.h Atomic support | ||
* | ||
* Copyright (C) 2022 Sebastian Reimers | ||
*/ | ||
|
||
#ifndef RE_H_ATOMIC__ | ||
#define RE_H_ATOMIC__ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* C11 */ | ||
#ifdef HAVE_ATOMIC | ||
#include <stdatomic.h> | ||
|
||
/* C99 */ | ||
#elif defined(__clang__) | ||
#define __CLANG_ATOMICS | ||
|
||
#elif defined(__GNUC__) | ||
#if __GNUC_PREREQ(4, 9) | ||
#define __SYNC_ATOMICS | ||
#else | ||
#error "Atomic requires gcc >= 4.9" | ||
#endif /* __GNUC_PREREQ */ | ||
|
||
#else | ||
#error "Your compiler does not support atomics" | ||
#endif /* HAVE_ATOMIC */ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* RE_H_ATOMIC__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters