From 60c5a0ac7f9e77af47670ad5da2bda7cb96caed6 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 4 Feb 2025 14:32:24 -0800 Subject: [PATCH] Peer review feedback. Thank you @jmalak --- CMakeLists.txt | 16 ++++++---------- src/ssl_load.c | 2 +- wolfcrypt/benchmark/benchmark.c | 2 +- wolfcrypt/src/random.c | 2 +- wolfssl/internal.h | 4 ++-- wolfssl/test.h | 2 +- wolfssl/wolfcrypt/wc_port.h | 8 ++++---- 7 files changed, 16 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40661019d..e72c65e07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2491,9 +2491,7 @@ if(WOLFSSL_EXAMPLES) add_executable(tls_bench ${CMAKE_CURRENT_SOURCE_DIR}/examples/benchmark/tls_bench.c) target_link_libraries(tls_bench wolfssl) - if(NOT CMAKE_C_COMPILER_ID STREQUAL "OpenWatcom") - target_link_libraries(tls_bench Threads::Threads) - endif() + target_link_libraries(tls_bench Threads::Threads) set_property(TARGET tls_bench PROPERTY RUNTIME_OUTPUT_DIRECTORY ${WOLFSSL_OUTPUT_BASE}/examples/benchmark) @@ -2515,9 +2513,7 @@ if(WOLFSSL_EXAMPLES) ${CMAKE_CURRENT_BINARY_DIR}) target_compile_options(unit_test PUBLIC "-DNO_MAIN_DRIVER") target_link_libraries(unit_test wolfssl) - if(NOT CMAKE_C_COMPILER_ID STREQUAL "OpenWatcom") - target_link_libraries(unit_test Threads::Threads) - endif() + target_link_libraries(unit_test Threads::Threads) set_property(TARGET unit_test PROPERTY RUNTIME_OUTPUT_DIRECTORY ${WOLFSSL_OUTPUT_BASE}/tests/) @@ -2778,12 +2774,12 @@ if(WOLFSSL_INSTALL) else() set(LIBM) endif() - - configure_file(support/wolfssl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() + configure_file(support/wolfssl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + include(CMakePackageConfigHelpers) configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config.cmake" diff --git a/src/ssl_load.c b/src/ssl_load.c index 084fd2cdf..066df7024 100644 --- a/src/ssl_load.c +++ b/src/ssl_load.c @@ -35,7 +35,7 @@ #ifdef WOLFSSL_SYS_CA_CERTS #ifdef _WIN32 - #define _WINSOCKAPI_ /* Force winsock (workaround for WinCE) */ + #define _WINSOCKAPI_ /* block inclusion of winsock.h header file */ #include #include diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index e63359c7b..87197104e 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -14463,7 +14463,7 @@ void bench_sphincsKeySign(byte level, byte optim) #if defined(_WIN32) && !defined(INTIME_RTOS) #define WIN32_LEAN_AND_MEAN - #define _WINSOCKAPI_ /* Force winsock (workaround for WinCE) */ + #define _WINSOCKAPI_ /* block inclusion of winsock.h header file */ #include double current_time(int reset) diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 05178206d..a0ffc7ef6 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -87,7 +87,7 @@ This library contains implementation for the random number generator. #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 #endif - #define _WINSOCKAPI_ /* Force winsock (workaround for WinCE) */ + #define _WINSOCKAPI_ /* block inclusion of winsock.h header file */ #include #include #elif defined(HAVE_WNR) diff --git a/wolfssl/internal.h b/wolfssl/internal.h index cedc04870..d7a8cd9a7 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -154,7 +154,7 @@ #ifdef __WATCOMC__ #if defined(__OS2__) #elif defined(__NT__) - #define _WINSOCKAPI_ /* Force winsock (workaround for WinCE) */ + #define _WINSOCKAPI_ /* block inclusion of winsock.h header file */ #include #elif defined(__LINUX__) #ifndef SINGLE_THREADED @@ -166,7 +166,7 @@ #ifdef WOLFSSL_GAME_BUILD #include "system/xtl.h" #else - #define _WINSOCKAPI_ /* Force winsock (workaround for WinCE) */ + #define _WINSOCKAPI_ /* block inclusion of winsock.h header file */ #include #endif #elif defined(THREADX) diff --git a/wolfssl/test.h b/wolfssl/test.h index 87f31f5d9..cb64dfa1a 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -2132,7 +2132,7 @@ static WC_INLINE unsigned int my_psk_client_cs_cb(WOLFSSL* ssl, #elif defined(USE_WINDOWS_API) #define WIN32_LEAN_AND_MEAN - #define _WINSOCKAPI_ /* Force winsock (workaround for WinCE) */ + #define _WINSOCKAPI_ /* block inclusion of winsock.h header file */ #include static WC_INLINE double current_time(int reset) diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index db8ec6a4d..439832796 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -123,7 +123,7 @@ #if defined(__WATCOMC__) #if !defined(SINGLE_THREADED) #if defined(USE_WINDOWS_API) - #define _WINSOCKAPI_ /* Force winsock (workaround for WinCE) */ + #define _WINSOCKAPI_ /* block inclusion of winsock.h header file */ #include #include #elif defined(__OS2__) @@ -141,7 +141,7 @@ #endif #else #if defined(USE_WINDOWS_API) - #define _WINSOCKAPI_ /* Force winsock (workaround for WinCE) */ + #define _WINSOCKAPI_ /* block inclusion of winsock.h header file */ #include #elif defined(__OS2__) #include @@ -160,7 +160,7 @@ #define WIN32_LEAN_AND_MEAN #endif #if !defined(WOLFSSL_SGX) && !defined(WOLFSSL_NOT_WINDOWS_API) - #define _WINSOCKAPI_ /* Force winsock (workaround for WinCE) */ + #define _WINSOCKAPI_ /* block inclusion of winsock.h header file */ #include #ifndef WOLFSSL_USER_IO #include /* required for InetPton */ @@ -1205,7 +1205,7 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void); #define XGMTIME(c, t) gmtime((c)) #elif defined(_WIN32_WCE) - #define _WINSOCKAPI_ /* Force winsock (workaround for WinCE) */ + #define _WINSOCKAPI_ /* block inclusion of winsock.h header file */ #include #include /* For file system */