sspi: add local helper macro to avoid UNICODE branching
No binary (build failed)
—
(log yok)
| @@ -181,13 +181,7 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp, | |
| identity->DomainLength = curlx_uztoul(domlen); | |
| dup_domain.tchar_ptr = NULL; | |
| - | /* Setup the identity's flags */ |
| - | identity->Flags = (unsigned long) |
| - | #ifdef UNICODE |
| - | SEC_WINNT_AUTH_IDENTITY_UNICODE; |
| - | #else |
| - | SEC_WINNT_AUTH_IDENTITY_ANSI; |
| - | #endif |
| + | identity->Flags = CURL_SEC_WINNT_AUTH_IDENTITY; |
| return CURLE_OK; | |
| } | |
| @@ -29,6 +29,13 @@ | |
| #include <sspi.h> | |
| + | /* Local helper macro */ |
| + | #ifdef UNICODE |
| + | #define CURL_SEC_WINNT_AUTH_IDENTITY SEC_WINNT_AUTH_IDENTITY_UNICODE |
| + | #else |
| + | #define CURL_SEC_WINNT_AUTH_IDENTITY SEC_WINNT_AUTH_IDENTITY_ANSI |
| + | #endif |
| + | |
| /* Offered by mingw-w64 v9+, MS SDK 7.0A/VS2010+ */ | |
| #ifndef SECPKG_ATTR_ENDPOINT_BINDINGS | |
| #define SECPKG_ATTR_ENDPOINT_BINDINGS 26 | |
| @@ -154,12 +154,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, | |
| memset(&nego->identity, 0, sizeof(nego->identity)); | |
| nego->identity.Version = SEC_WINNT_AUTH_IDENTITY_VERSION; | |
| nego->identity.Length = sizeof(nego->identity); | |
| - | nego->identity.Flags = |
| - | #ifdef UNICODE |
| - | SEC_WINNT_AUTH_IDENTITY_UNICODE; |
| - | #else |
| - | SEC_WINNT_AUTH_IDENTITY_ANSI; |
| - | #endif |
| + | nego->identity.Flags = CURL_SEC_WINNT_AUTH_IDENTITY; |
| nego->p_identity = &nego->identity; | |
| } | |