Merge pull request #6495 from JacobBarthelmeh/build

update check for stdatomic header file
This commit is contained in:
Sean Parkinson
2023-06-14 14:00:04 +10:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@ -100,10 +100,11 @@ else
fi 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_CHECK_LIB([network],[socket])
AC_C_BIGENDIAN AC_C_BIGENDIAN
AC_C___ATOMIC 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 # check if functions of interest are linkable, but also check if
# they're declared by the expected headers, and if not, supersede the # they're declared by the expected headers, and if not, supersede the

View File

@ -307,12 +307,12 @@
#define WOLFSSL_ATOMIC_OPS #define WOLFSSL_ATOMIC_OPS
#endif #endif
#else #else
#ifdef HAVE_STDATOMIC_H #ifdef WOLFSSL_HAVE_ATOMIC_H
/* Default C Implementation */ /* Default C Implementation */
#include <stdatomic.h> #include <stdatomic.h>
typedef atomic_int wolfSSL_Atomic_Int; typedef atomic_int wolfSSL_Atomic_Int;
#define WOLFSSL_ATOMIC_OPS #define WOLFSSL_ATOMIC_OPS
#endif /* HAVE_STDATOMIC_H */ #endif /* WOLFSSL_HAVE_ATOMIC_H */
#endif #endif
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
/* Use MSVC compiler intrinsics for atomic ops */ /* Use MSVC compiler intrinsics for atomic ops */