Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorBrian Smith <brian@briansmith.org>2015-01-28 10:06:00 +0300
committerAdam Langley <agl@google.com>2015-01-28 23:36:49 +0300
commitdc94b54708177172c8afca5cea406d992f3c7e51 (patch)
treebb075c143f2ebc376de35557d5bf518e863fc6cc /crypto
parent33970e6ce0de1a553bd57d5b42527cd95292acae (diff)
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>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/bio/bio_test.c1
-rw-r--r--crypto/bio/connect.c4
-rw-r--r--crypto/bio/fd.c1
-rw-r--r--crypto/bio/internal.h3
-rw-r--r--crypto/bio/socket.c3
-rw-r--r--crypto/bio/socket_helper.c2
-rw-r--r--crypto/directory_win.c1
-rw-r--r--crypto/err/err.c1
-rw-r--r--crypto/mem.c1
-rw-r--r--crypto/rand/windows.c1
-rw-r--r--crypto/thread.c1
11 files changed, 16 insertions, 3 deletions
diff --git a/crypto/bio/bio_test.c b/crypto/bio/bio_test.c
index db6fc026..57684df5 100644
--- a/crypto/bio/bio_test.c
+++ b/crypto/bio/bio_test.c
@@ -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>
diff --git a/crypto/bio/connect.c b/crypto/bio/connect.c
index 9bd87d4f..55b9352a 100644
--- a/crypto/bio/connect.c
+++ b/crypto/bio/connect.c
@@ -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>
diff --git a/crypto/bio/fd.c b/crypto/bio/fd.c
index bc47e746..c5133d80 100644
--- a/crypto/bio/fd.c
+++ b/crypto/bio/fd.c
@@ -61,6 +61,7 @@
#if !defined(OPENSSL_WINDOWS)
#include <unistd.h>
#else
+#define WIN32_LEAN_AND_MEAN
#include <io.h>
#include <Windows.h>
#endif
diff --git a/crypto/bio/internal.h b/crypto/bio/internal.h
index ba28839a..d9a34f18 100644
--- a/crypto/bio/internal.h
+++ b/crypto/bio/internal.h
@@ -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)
diff --git a/crypto/bio/socket.c b/crypto/bio/socket.c
index 90ae14a6..6d393a22 100644
--- a/crypto/bio/socket.c
+++ b/crypto/bio/socket.c
@@ -61,6 +61,9 @@
#if !defined(OPENSSL_WINDOWS)
#include <unistd.h>
+#else
+#define WIN32_LEAN_AND_MEAN
+#include <WinSock2.h>
#endif
#include "internal.h"
diff --git a/crypto/bio/socket_helper.c b/crypto/bio/socket_helper.c
index ba65a1a4..801800a5 100644
--- a/crypto/bio/socket_helper.c
+++ b/crypto/bio/socket_helper.c
@@ -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"
diff --git a/crypto/directory_win.c b/crypto/directory_win.c
index 4956383d..203d4a20 100644
--- a/crypto/directory_win.c
+++ b/crypto/directory_win.c
@@ -30,6 +30,7 @@
#if defined(OPENSSL_WINDOWS)
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h>
#include <errno.h>
diff --git a/crypto/err/err.c b/crypto/err/err.c
index 892b2ac8..5ee81ca8 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -115,6 +115,7 @@
#include <stdio.h>
#if defined(OPENSSL_WINDOWS)
+#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#endif
diff --git a/crypto/mem.c b/crypto/mem.c
index 11ef3352..83414117 100644
--- a/crypto/mem.c
+++ b/crypto/mem.c
@@ -65,6 +65,7 @@
#include <string.h>
#if defined(OPENSSL_WINDOWS)
+#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#else
#include <strings.h>
diff --git a/crypto/rand/windows.c b/crypto/rand/windows.c
index ed6e5e9e..86bea858 100644
--- a/crypto/rand/windows.c
+++ b/crypto/rand/windows.c
@@ -16,6 +16,7 @@
#if defined(OPENSSL_WINDOWS)
+#define WIN32_LEAN_AND_MEAN
#include <limits.h>
#include <stdlib.h>
#include <Windows.h>
diff --git a/crypto/thread.c b/crypto/thread.c
index 15e38bdd..b1b4d00e 100644
--- a/crypto/thread.c
+++ b/crypto/thread.c
@@ -59,6 +59,7 @@
#include <errno.h>
#if defined(OPENSSL_WINDOWS)
+#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#endif