Skip to content

Commit

Permalink
Fix C11 compiler probe
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhop committed Aug 1, 2024
1 parent 367eaf0 commit c65fe8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if(CMAKE_VERSION VERSION_GREATER "3.1.0")
RESULT
${PROJECT_BINARY_DIR}
SOURCES "${CMAKE_CURRENT_LIST_DIR}/tests/compiler_features_tests/simple_main.c"
CMAKE_FLAGS "-DCMAKE_C_FLAGS=\"-std=c11\"")
COMPILE_DEFINITIONS -c -std=c11)
if(RESULT)
set(CMAKE_C_STANDARD 11)
else()
Expand Down
3 changes: 3 additions & 0 deletions crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,11 @@ OPENSSL_EXPORT void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void));
#if !defined(OPENSSL_C11_ATOMIC) && defined(OPENSSL_THREADS) && \
!defined(__STDC_NO_ATOMICS__) && defined(__STDC_VERSION__) && \
__STDC_VERSION__ >= 201112L
#include <stdatomic.h>
#if ATOMIC_LONG_LOCK_FREE > 0
#define OPENSSL_C11_ATOMIC
#endif
#endif

// Older MSVC does not support C11 atomics, so we fallback to the Windows APIs.
// This can be removed once we can rely on
Expand Down

0 comments on commit c65fe8d

Please sign in to comment.