diff --git a/configure.ac b/configure.ac index 7521f0d1c..92b9ced52 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,9 @@ CC="$PTHREAD_CC" CXX="$PTHREAD_CXX" ]) +# Atomics +AC_CHECK_HEADERS([stdatomic.h]) + # Check for poll.h (it's in POSIX so everyone should have it?) AC_CHECK_HEADERS([poll.h]) diff --git a/src/iperf.h b/src/iperf.h index 87b7b0ed2..87f787fd5 100644 --- a/src/iperf.h +++ b/src/iperf.h @@ -1,5 +1,5 @@ /* - * iperf, Copyright (c) 2014-2020, The Regents of the University of + * iperf, Copyright (c) 2014-2020, 2023, The Regents of the University of * California, through Lawrence Berkeley National Laboratory (subject * to receipt of any required approvals from the U.S. Dept. of * Energy). All rights reserved. @@ -73,8 +73,13 @@ #include #endif // HAVE_SSL +#ifdef HAVE_PTHREAD #include +#endif // HAVE_PTHREAD + +#ifdef HAVE_STDATOMIC_H #include +#endif // HAVE_STDATOMIC_H #if !defined(__IPERF_API_H) //typedef uint64_t iperf_size_t; diff --git a/src/iperf_api.h b/src/iperf_api.h index 1c2cb7ec3..fd2ab6bc6 100644 --- a/src/iperf_api.h +++ b/src/iperf_api.h @@ -1,5 +1,5 @@ /* - * iperf, Copyright (c) 2014-2022, The Regents of the University of + * iperf, Copyright (c) 2014-2023, The Regents of the University of * California, through Lawrence Berkeley National Laboratory (subject * to receipt of any required approvals from the U.S. Dept. of * Energy). All rights reserved. @@ -38,7 +38,9 @@ extern "C" { /* open extern "C" */ #endif +#ifdef HAVE_STDATOMIC_H #include +#endif // HAVE_STDATOMIC_H struct iperf_test; struct iperf_stream_result;