Avoid using |WIN32| and use |OPENSSL_WINDOWS| instead. MSVC and clang-cl automatically define |_WIN32| but |WIN32| is only defined if a Windows header file has been included or if -DWIN32 was passed on the command line. Thus, it is always better to test |_WIN32| than |WIN32|. The convention in BoringSSL is to test |OPENSSL_WINDOWS| instead, except for the place where |OPENSSL_WINDOWS| is defined. Change-Id: Icf3e03958895be32efe800e689d5ed6a2fed215f Reviewed-on: https://boringssl-review.googlesource.com/5553 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/err/err.c b/crypto/err/err.c index 417d322..24824e8 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c
@@ -633,7 +633,7 @@ } if (library == ERR_LIB_SYS && reason == 0) { -#if defined(WIN32) +#if defined(OPENSSL_WINDOWS) reason = GetLastError(); #else reason = errno;