Skip to content

Commit

Permalink
[Build] Improve std::atomic test macro
Browse files Browse the repository at this point in the history
Detection was lacking for some compiler/host combos, resulting in
erratic linking errors
  • Loading branch information
Fuzzbawls committed Jan 8, 2022
1 parent da647d4 commit 55babf4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build-aux/m4/l_atomic.m4
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ dnl warranty.
m4_define([_CHECK_ATOMIC_testbody], [[
#include <atomic>
#include <cstdint>
#include <chrono>
using namespace std::chrono_literals;
int main() {
std::atomic<bool> lock{true};
std::atomic_exchange(&lock, false);
std::atomic<std::chrono::seconds> t{0s};
t.store(2s);
std::atomic<int64_t> a{};
int64_t v = 5;
Expand Down
1 change: 1 addition & 0 deletions src/util/threadnames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <config/pivx-config.h>
#endif

#include <atomic>
#include <thread>

#if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))
Expand Down

0 comments on commit 55babf4

Please sign in to comment.