diff options
author | Maria Matejka <mq@ucw.cz> | 2022-02-04 15:42:04 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-02-04 15:42:04 +0100 |
commit | cc73726620da84a8ed79cf852384226aa05e5458 (patch) | |
tree | cdcc5fc11d52d4d54996d643cc2319cb53706d5c /proto | |
parent | fe840ddad96259ed7b2f1d0d2f07bdf8d4c03384 (diff) |
Compilation fixes for CLang
Diffstat (limited to 'proto')
-rw-r--r-- | proto/bfd/bfd.c | 2 | ||||
-rw-r--r-- | proto/bfd/bfd.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/proto/bfd/bfd.c b/proto/bfd/bfd.c index 63e0deff..479c1510 100644 --- a/proto/bfd/bfd.c +++ b/proto/bfd/bfd.c @@ -124,7 +124,7 @@ static struct { list proto_list; } bfd_global; -static struct bfd_session bfd_admin_down = { .loc = { .state = BFD_STATE_ADMIN_DOWN }, }; +static struct bfd_session bfd_admin_down = { .loc = ATOMIC_VAR_INIT((struct bfd_session_state) { .state = BFD_STATE_ADMIN_DOWN }), }; const char *bfd_state_names[] = { "AdminDown", "Down", "Init", "Up" }; diff --git a/proto/bfd/bfd.h b/proto/bfd/bfd.h index b3266857..ffb1c43f 100644 --- a/proto/bfd/bfd.h +++ b/proto/bfd/bfd.h @@ -128,7 +128,7 @@ struct bfd_session _Atomic struct bfd_session_state loc; struct bfd_session_state rem; -#define BFD_LOC_STATE(s) atomic_load_explicit(&(s)->loc, memory_order_relaxed) +#define BFD_LOC_STATE(s) ({ struct bfd_session_state _bss = atomic_load_explicit(&(s)->loc, memory_order_relaxed); _bss; }) u32 loc_id; /* Local session ID (local discriminator) */ u32 rem_id; /* Remote session ID (remote discriminator) */ |