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>
This commit is contained in:
Brian Smith
2015-07-31 22:34:34 +00:00
committed by Adam Langley
parent b748373286
commit 8a36e53abb
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -88,7 +88,7 @@
#define BIO_FP_APPEND 0x08
static FILE *open_file(const char *filename, const char *mode) {
#if defined(_WIN32) && defined(CP_UTF8)
#if defined(OPENSSL_WINDOWS) && defined(CP_UTF8)
int sz, len_0 = (int)strlen(filename) + 1;
DWORD flags;
+1 -1
View File
@@ -633,7 +633,7 @@ void ERR_put_error(int library, int reason, const char *function,
}
if (library == ERR_LIB_SYS && reason == 0) {
#if defined(WIN32)
#if defined(OPENSSL_WINDOWS)
reason = GetLastError();
#else
reason = errno;
+1 -1
View File
@@ -98,7 +98,7 @@ extern "C" {
#define OPENSSL_APPLE
#endif
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
#define OPENSSL_WINDOWS
#endif