Clean up use of Windows Platform SDK headers.

Define WIN32_LEAN_AND_MEAN before including Windows Platform SDK
headers to preempt naming conflicts and to make the build faster. Avoid
including those headers in BoringSSL headers. Document that Platform
SDK 8.1 or later is required on Windows.

Change-Id: I907ada21dc722527ea37e839c71c5157455a7003
Reviewed-on: https://boringssl-review.googlesource.com/3100
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
Brian Smith
2015-01-28 20:36:49 +00:00
committed by Adam Langley
parent 33970e6ce0
commit dc94b54708
14 changed files with 19 additions and 6 deletions
+2 -2
View File
@@ -14,8 +14,8 @@ Build Prerequisites:
* On Windows only, Yasm[4] is required.
* A C compiler is required. On Windows, MSVC 12 (Visual Studio 2013) or later
are supported. Recent versions of GCC and Clang should work on non-Windows
platforms, and maybe on Windows too.
with Platform SDK 8.1 or later are supported. Recent versions of GCC and
Clang should work on non-Windows platforms, and maybe on Windows too.
* Bash is required for running some tests, but not for building.
+1
View File
@@ -26,6 +26,7 @@
#include <sys/socket.h>
#include <unistd.h>
#else
#define WIN32_LEAN_AND_MEAN
#include <io.h>
#include <WinSock2.h>
#include <WS2tcpip.h>
+4
View File
@@ -65,6 +65,10 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#else
#define WIN32_LEAN_AND_MEAN
#include <WinSock2.h>
#include <WS2tcpip.h>
#endif
#include <openssl/buf.h>
+1
View File
@@ -61,6 +61,7 @@
#if !defined(OPENSSL_WINDOWS)
#include <unistd.h>
#else
#define WIN32_LEAN_AND_MEAN
#include <io.h>
#include <Windows.h>
#endif
+1 -2
View File
@@ -67,8 +67,7 @@ typedef unsigned short u_short;
#include <sys/types.h>
#include <sys/socket.h>
#else
#include <WinSock2.h>
#include <WS2tcpip.h>
typedef int socklen_t;
#endif
#if defined(__cplusplus)
+3
View File
@@ -61,6 +61,9 @@
#if !defined(OPENSSL_WINDOWS)
#include <unistd.h>
#else
#define WIN32_LEAN_AND_MEAN
#include <WinSock2.h>
#endif
#include "internal.h"
+1 -1
View File
@@ -24,9 +24,9 @@
#include <netdb.h>
#include <unistd.h>
#else
#define WIN32_LEAN_AND_MEAN
#include <WinSock2.h>
#include <WS2tcpip.h>
typedef int socklen_t;
#endif
#include "internal.h"
+1
View File
@@ -30,6 +30,7 @@
#if defined(OPENSSL_WINDOWS)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h>
#include <errno.h>
+1
View File
@@ -115,6 +115,7 @@
#include <stdio.h>
#if defined(OPENSSL_WINDOWS)
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#endif
+1
View File
@@ -65,6 +65,7 @@
#include <string.h>
#if defined(OPENSSL_WINDOWS)
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#else
#include <strings.h>
+1
View File
@@ -16,6 +16,7 @@
#if defined(OPENSSL_WINDOWS)
#define WIN32_LEAN_AND_MEAN
#include <limits.h>
#include <stdlib.h>
#include <Windows.h>
+1
View File
@@ -59,6 +59,7 @@
#include <errno.h>
#if defined(OPENSSL_WINDOWS)
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#endif
+1
View File
@@ -27,6 +27,7 @@
#include <openssl/rsa.h>
#if defined(OPENSSL_WINDOWS)
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#elif defined(OPENSSL_APPLE)
#include <sys/time.h>
-1
View File
@@ -35,7 +35,6 @@
#include <io.h>
#include <WinSock2.h>
#include <WS2tcpip.h>
typedef int socklen_t;
typedef int ssize_t;
#define read _read
#define write _write