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
commit 82cc988226
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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 */