Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct comment for _WINSOCKAPI_ macro manipulation #8491

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ssl_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define _WINSOCKAPI_ /* block inclusion of winsock.h header file */
#include <windows.h>
#include <wincrypt.h>
#undef _WINSOCKAPI_
#undef _WINSOCKAPI_ /* undefine it for MINGW winsock2.h header file */

/* mingw gcc does not support pragma comment, and the
* linking with crypt32 is handled in configure.ac */
Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/benchmark/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -14584,7 +14584,7 @@ void bench_sphincsKeySign(byte level, byte optim)
#define WIN32_LEAN_AND_MEAN
#define _WINSOCKAPI_ /* block inclusion of winsock.h header file */
#include <windows.h>
#undef _WINSOCKAPI_
#undef _WINSOCKAPI_ /* undefine it for MINGW winsock2.h header file */

double current_time(int reset)
{
Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/src/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ This library contains implementation for the random number generator.
#define _WINSOCKAPI_ /* block inclusion of winsock.h header file */
#include <windows.h>
#include <wincrypt.h>
#undef _WINSOCKAPI_
#undef _WINSOCKAPI_ /* undefine it for MINGW winsock2.h header file */
#elif defined(HAVE_WNR)
#include <wnr.h>
#include <wolfssl/wolfcrypt/logging.h>
Expand Down
4 changes: 2 additions & 2 deletions wolfssl/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
#elif defined(__NT__)
#define _WINSOCKAPI_ /* block inclusion of winsock.h header file */
#include <windows.h>
#undef _WINSOCKAPI_
#undef _WINSOCKAPI_ /* undefine it for MINGW winsock2.h header file */
#elif defined(__LINUX__)
#ifndef SINGLE_THREADED
#define WOLFSSL_PTHREADS
Expand All @@ -169,7 +169,7 @@
#else
#define _WINSOCKAPI_ /* block inclusion of winsock.h header file */
#include <windows.h>
#undef _WINSOCKAPI_
#undef _WINSOCKAPI_ /* undefine it for MINGW winsock2.h header file */
#endif
#elif defined(THREADX)
#ifndef SINGLE_THREADED
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,7 @@ static WC_INLINE unsigned int my_psk_client_cs_cb(WOLFSSL* ssl,
#define WIN32_LEAN_AND_MEAN
#define _WINSOCKAPI_ /* block inclusion of winsock.h header file */
#include <windows.h>
#undef _WINSOCKAPI_
#undef _WINSOCKAPI_ /* undefine it for MINGW winsock2.h header file */

static WC_INLINE double current_time(int reset)
{
Expand Down
6 changes: 4 additions & 2 deletions wolfssl/wolfcrypt/wc_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
#if defined(USE_WINDOWS_API)
#define _WINSOCKAPI_ /* block inclusion of winsock.h header file */
#include <windows.h>
#undef _WINSOCKAPI_ /* undefine it for MINGW winsock2.h header file */
#include <process.h>
#elif defined(__OS2__)
#define INCL_DOSSEMAPHORES
Expand All @@ -143,6 +144,7 @@
#if defined(USE_WINDOWS_API)
#define _WINSOCKAPI_ /* block inclusion of winsock.h header file */
#include <windows.h>
#undef _WINSOCKAPI_ /* undefine it for MINGW winsock2.h header file */
#elif defined(__OS2__)
#include <os2.h>
#endif
Expand All @@ -162,8 +164,7 @@
#if !defined(WOLFSSL_SGX) && !defined(WOLFSSL_NOT_WINDOWS_API)
#define _WINSOCKAPI_ /* block inclusion of winsock.h header file. */
#include <windows.h>
/* winsock2.h expects _WINSOCKAPI_ to be undef, and defines it. */
#undef _WINSOCKAPI_
#undef _WINSOCKAPI_ /* undefine it for MINGW winsock2.h header file */
#ifndef WOLFSSL_USER_IO
#include <winsock2.h>
#include <ws2tcpip.h> /* required for InetPton */
Expand Down Expand Up @@ -1218,6 +1219,7 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
#elif defined(_WIN32_WCE)
#define _WINSOCKAPI_ /* block inclusion of winsock.h header file */
#include <windows.h>
#undef _WINSOCKAPI_ /* undefine it for MINGW winsock2.h header file */
#include <stdlib.h> /* For file system */

time_t windows_time(time_t* timer);
Expand Down
Loading