diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-05-02 15:35:41 +0200 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-05-20 08:17:05 +0200 |
| commit | 8cea9fdd2831a0bcf735d323796104cd8f318133 (patch) | |
| tree | 21bfc2722e1e6b06d665424803f65376cecdc6cd /src/ipcpd | |
| parent | 2ddcad3989cd8d2314453ed31ff43e122118663f (diff) | |
| download | ouroboros-8cea9fdd2831a0bcf735d323796104cd8f318133.tar.gz ouroboros-8cea9fdd2831a0bcf735d323796104cd8f318133.zip | |
include: Centralise atomic helpers in atomics.h
Moves the atomics macros that were defined between eth and ssm_pool to
their own header.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd')
| -rw-r--r-- | src/ipcpd/eth/eth.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c index d7894cf6..7981ade5 100644 --- a/src/ipcpd/eth/eth.c +++ b/src/ipcpd/eth/eth.c @@ -37,6 +37,7 @@ #include "config.h" +#include <ouroboros/atomics.h> #include <ouroboros/endian.h> #include <ouroboros/hash.h> #include <ouroboros/errno.h> @@ -53,12 +54,10 @@ #include <ouroboros/pthread.h> #include <ouroboros/rib.h> -#ifdef IPCP_ETH_FLOW_STATS -#define LOAD_RELAXED(p) __atomic_load_n(p, __ATOMIC_RELAXED) -#define FETCH_ADD_RELAXED(p, v) __atomic_fetch_add(p, v, __ATOMIC_RELAXED) -#define FETCH_SUB_RELAXED(p, v) __atomic_fetch_sub(p, v, __ATOMIC_RELAXED) -#else +#ifndef IPCP_ETH_FLOW_STATS +#undef FETCH_ADD_RELAXED #define FETCH_ADD_RELAXED(p, v) ((void) 0) +#undef FETCH_SUB_RELAXED #define FETCH_SUB_RELAXED(p, v) ((void) 0) #endif |
