mirror of
https://github.com/FRRouting/frr.git
synced 2026-01-16 23:14:01 +00:00
It's 2025, we can assume ISO C11 support in the compiler. Just retain the few lines needed for C++. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
31 lines
726 B
C++
31 lines
726 B
C++
// SPDX-License-Identifier: ISC
|
|
/*
|
|
* Copyright (c) 2015-16 David Lamparter, for NetDEF, Inc.
|
|
*/
|
|
|
|
#ifndef _FRRATOMIC_H
|
|
#define _FRRATOMIC_H
|
|
|
|
/* C++ compatibility */
|
|
#ifdef __cplusplus
|
|
#include <stdint.h>
|
|
#include <atomic>
|
|
using std::atomic_int;
|
|
using std::memory_order;
|
|
using std::memory_order_relaxed;
|
|
using std::memory_order_acquire;
|
|
using std::memory_order_release;
|
|
using std::memory_order_acq_rel;
|
|
using std::memory_order_consume;
|
|
using std::memory_order_seq_cst;
|
|
|
|
typedef std::atomic<bool> atomic_bool;
|
|
typedef std::atomic<size_t> atomic_size_t;
|
|
typedef std::atomic<uint_fast32_t> atomic_uint_fast32_t;
|
|
typedef std::atomic<uintptr_t> atomic_uintptr_t;
|
|
|
|
#else
|
|
#include <stdatomic.h>
|
|
#endif
|
|
|
|
#endif /* _FRRATOMIC_H */
|