Browse Source

Merge pull request #6495 from JacobBarthelmeh/build

update check for stdatomic header file
Sean Parkinson 10 months ago
parent
commit
82cc988226
2 changed files with 4 additions and 3 deletions
  1. 2 1
      configure.ac
  2. 2 2
      wolfssl/wolfcrypt/wc_port.h

+ 2 - 1
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

+ 2 - 2
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 <stdatomic.h>
     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 */