diff --git a/configure.ac b/configure.ac index 45a3939fc..26e7a754e 100644 --- a/configure.ac +++ b/configure.ac @@ -100,10 +100,11 @@ else fi -AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h time.h sys/ioctl.h sys/socket.h sys/time.h errno.h sys/un.h stdatomic.h]) +AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h time.h sys/ioctl.h sys/socket.h sys/time.h errno.h sys/un.h]) AC_CHECK_LIB([network],[socket]) AC_C_BIGENDIAN AC_C___ATOMIC +AC_CHECK_HEADER(stdatomic.h, [AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSL_HAVE_ATOMIC_H"],[]) # check if functions of interest are linkable, but also check if # they're declared by the expected headers, and if not, supersede the diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index 3f8ee4f77..7b4528418 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -307,12 +307,12 @@ #define WOLFSSL_ATOMIC_OPS #endif #else - #ifdef HAVE_STDATOMIC_H + #ifdef WOLFSSL_HAVE_ATOMIC_H /* Default C Implementation */ #include typedef atomic_int wolfSSL_Atomic_Int; #define WOLFSSL_ATOMIC_OPS - #endif /* HAVE_STDATOMIC_H */ + #endif /* WOLFSSL_HAVE_ATOMIC_H */ #endif #elif defined(_MSC_VER) /* Use MSVC compiler intrinsics for atomic ops */