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:
committed by
Adam Langley
parent
33970e6ce0
commit
dc94b54708
@@ -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.
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#if !defined(OPENSSL_WINDOWS)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <io.h>
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -61,6 +61,9 @@
|
||||
|
||||
#if !defined(OPENSSL_WINDOWS)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <WinSock2.h>
|
||||
#endif
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#if defined(OPENSSL_WINDOWS)
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -115,6 +115,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(OPENSSL_WINDOWS)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#if defined(OPENSSL_WINDOWS)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#if defined(OPENSSL_WINDOWS)
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <Windows.h>
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(OPENSSL_WINDOWS)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user