Skip to content

Commit

Permalink
Add autoconf test for stdatomic
Browse files Browse the repository at this point in the history
Also do conditional compilation for stdatomic and pthread.
  • Loading branch information
bmah888 committed Nov 8, 2023
1 parent b14c3b9 commit a326ec8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
7 changes: 6 additions & 1 deletion src/iperf.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -73,8 +73,13 @@
#include <openssl/evp.h>
#endif // HAVE_SSL

#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif // HAVE_PTHREAD

#ifdef HAVE_STDATOMIC_H
#include <stdatomic.h>
#endif // HAVE_STDATOMIC_H

#if !defined(__IPERF_API_H)
//typedef uint64_t iperf_size_t;
Expand Down
4 changes: 3 additions & 1 deletion src/iperf_api.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -38,7 +38,9 @@
extern "C" { /* open extern "C" */
#endif

#ifdef HAVE_STDATOMIC_H
#include <stdatomic.h>
#endif // HAVE_STDATOMIC_H

struct iperf_test;
struct iperf_stream_result;
Expand Down

0 comments on commit a326ec8

Please sign in to comment.