From: Viktor Szakats Date: Thu, 16 Jan 2025 14:31:54 +0000 (+0100) Subject: windows: drop dupe macros, detect `CURL_OS` for WinCE ARM, indentation X-Git-Tag: curl-8_12_0~94 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e2c6b0b4e8d41d4fca8cc93460a7597646e64d0;p=thirdparty%2Fcurl.git windows: drop dupe macros, detect `CURL_OS` for WinCE ARM, indentation - setup-win32: drop duplicate `WIN32_LEAN_AND_MEAN` and `NOGDI` macros (set earlier in `curl_setup.h`) - config-win32ce: detect ARM for `CURL_OS` macro. Based on: https://cegcc.sourceforge.net/docs/details.html It should also apply to MSVC. (untested) - indentation. Closes #16029 --- diff --git a/lib/config-win32ce.h b/lib/config-win32ce.h index 6012ceb511..71f893ce88 100644 --- a/lib/config-win32ce.h +++ b/lib/config-win32ce.h @@ -235,8 +235,12 @@ /* Define cpu-machine-OS */ #ifndef CURL_OS +#ifdef _M_ARM +#define CURL_OS "arm-pc-win32ce" +#else #define CURL_OS "i386-pc-win32ce" #endif +#endif /* ---------------------------------------------------------------- */ /* Windows CE */ diff --git a/lib/curl_sspi.h b/lib/curl_sspi.h index 535a1ff650..ac39afa253 100644 --- a/lib/curl_sspi.h +++ b/lib/curl_sspi.h @@ -81,27 +81,27 @@ extern PSecurityFunctionTable Curl_pSecFn; #endif #ifndef SEC_I_SIGNATURE_NEEDED -# define SEC_I_SIGNATURE_NEEDED ((HRESULT)0x0009035CL) +#define SEC_I_SIGNATURE_NEEDED ((HRESULT)0x0009035CL) #endif #ifndef CRYPT_E_REVOKED -# define CRYPT_E_REVOKED ((HRESULT)0x80092010L) +#define CRYPT_E_REVOKED ((HRESULT)0x80092010L) #endif #ifndef CRYPT_E_NO_REVOCATION_DLL -# define CRYPT_E_NO_REVOCATION_DLL ((HRESULT)0x80092011L) +#define CRYPT_E_NO_REVOCATION_DLL ((HRESULT)0x80092011L) #endif #ifndef CRYPT_E_NO_REVOCATION_CHECK -# define CRYPT_E_NO_REVOCATION_CHECK ((HRESULT)0x80092012L) +#define CRYPT_E_NO_REVOCATION_CHECK ((HRESULT)0x80092012L) #endif #ifndef CRYPT_E_REVOCATION_OFFLINE -# define CRYPT_E_REVOCATION_OFFLINE ((HRESULT)0x80092013L) +#define CRYPT_E_REVOCATION_OFFLINE ((HRESULT)0x80092013L) #endif #ifndef CRYPT_E_NOT_IN_REVOCATION_DATABASE -# define CRYPT_E_NOT_IN_REVOCATION_DATABASE ((HRESULT)0x80092014L) +#define CRYPT_E_NOT_IN_REVOCATION_DATABASE ((HRESULT)0x80092014L) #endif #ifdef UNICODE diff --git a/lib/setup-win32.h b/lib/setup-win32.h index a297bdcff4..70d83ad8e9 100644 --- a/lib/setup-win32.h +++ b/lib/setup-win32.h @@ -77,17 +77,6 @@ # if defined(_UNICODE) && !defined(UNICODE) # error "_UNICODE is defined but UNICODE is not defined" # endif -/* - * Do not include unneeded stuff in Windows headers to avoid compiler - * warnings and macro clashes. - * Make sure to define this macro before including any Windows headers. - */ -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# ifndef NOGDI -# define NOGDI -# endif # include # include # include diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 93348f05e2..8441b467d2 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -149,7 +149,7 @@ */ #ifndef CALG_SHA_256 -# define CALG_SHA_256 0x0000800c +#define CALG_SHA_256 0x0000800c #endif #ifndef PKCS12_NO_PERSIST_KEY diff --git a/tests/libtest/lib556.c b/tests/libtest/lib556.c index 36f845ff7a..31818dc8a2 100644 --- a/tests/libtest/lib556.c +++ b/tests/libtest/lib556.c @@ -28,13 +28,13 @@ /* For Windows, mainly (may be moved in a config file?) */ #ifndef STDIN_FILENO - #define STDIN_FILENO 0 +#define STDIN_FILENO 0 #endif #ifndef STDOUT_FILENO - #define STDOUT_FILENO 1 +#define STDOUT_FILENO 1 #endif #ifndef STDERR_FILENO - #define STDERR_FILENO 2 +#define STDERR_FILENO 2 #endif CURLcode test(char *URL)