Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
traversc committed Mar 19, 2024
1 parent e5bb578 commit 9435604
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
14 changes: 11 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2412,10 +2412,18 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <atomic>
std::atomic<int> x{0};
#include <cstdint>
std::atomic<std::uint64_t> x1{0};
std::atomic<std::uint8_t> x2{0};
std::atomic<char*> x3{nullptr};
std::atomic<bool> x4{false};
int main() {
x.fetch_add(1);
return 0;
x1.fetch_add(1);
x2.fetch_add(1);
char temp = 'a';
x3.store(&temp);
x4.store(true);
return 0;
}
_ACEOF
Expand Down
14 changes: 11 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,18 @@ echo $(($MAJOR*100000+$MINOR*100+$RELEASE))
# Check if simple C++ program using atomic header can compile using AC_COMPILE_IFELSE
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <atomic>
std::atomic<int> x{0};
#include <cstdint>
std::atomic<std::uint64_t> x1{0};
std::atomic<std::uint8_t> x2{0};
std::atomic<char*> x3{nullptr};
std::atomic<bool> x4{false};
int main() {
x.fetch_add(1);
return 0;
x1.fetch_add(1);
x2.fetch_add(1);
char temp = 'a';
x3.store(&temp);
x4.store(true);
return 0;
}
]])], [NEED_LIBATOMIC="no"], [NEED_LIBATOMIC="yes"])

Expand Down

0 comments on commit 9435604

Please sign in to comment.