diff options
author | David Benjamin <davidben@google.com> | 2016-06-09 23:48:33 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2016-06-10 00:29:36 +0300 |
commit | a353cdb67191a6eacd3409cc642816574084b871 (patch) | |
tree | 2f8c27a7e50a00dde795aa6621a001265e99a8d1 /crypto/bio | |
parent | 2e8ba2d25d18d37ac36f5aea07b546c7221d4d1c (diff) |
Wrap MSVC-only warning pragmas in a macro.
There's a __pragma expression which allows this. Android builds us Windows with
MinGW for some reason, so we actually do have to tolerate non-MSVC-compatible
Windows compilers. (Clang for Windows is much more sensible than MinGW and
intentionally mimicks MSVC.)
MinGW doesn't understand MSVC's pragmas and warns a lot. #pragma warning is
safe to suppress, so wrap those to shush them. This also lets us do away with a
few ifdefs.
Change-Id: I1f5a8bec4940d4b2d947c4c1cc9341bc15ec4972
Reviewed-on: https://boringssl-review.googlesource.com/8236
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bio_test.cc | 4 | ||||
-rw-r--r-- | crypto/bio/connect.c | 4 | ||||
-rw-r--r-- | crypto/bio/fd.c | 4 | ||||
-rw-r--r-- | crypto/bio/internal.h | 4 | ||||
-rw-r--r-- | crypto/bio/socket.c | 4 | ||||
-rw-r--r-- | crypto/bio/socket_helper.c | 4 |
6 files changed, 12 insertions, 12 deletions
diff --git a/crypto/bio/bio_test.cc b/crypto/bio/bio_test.cc index 3615ab46..f2eb20ba 100644 --- a/crypto/bio/bio_test.cc +++ b/crypto/bio/bio_test.cc @@ -27,10 +27,10 @@ #include <unistd.h> #else #include <io.h> -#pragma warning(push, 3) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) #include <winsock2.h> #include <ws2tcpip.h> -#pragma warning(pop) +OPENSSL_MSVC_PRAGMA(warning(pop)) #endif #include <openssl/bio.h> diff --git a/crypto/bio/connect.c b/crypto/bio/connect.c index 45694960..7e544474 100644 --- a/crypto/bio/connect.c +++ b/crypto/bio/connect.c @@ -66,10 +66,10 @@ #include <arpa/inet.h> #include <unistd.h> #else -#pragma warning(push, 3) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) #include <winsock2.h> #include <ws2tcpip.h> -#pragma warning(pop) +OPENSSL_MSVC_PRAGMA(warning(pop)) #endif #include <openssl/buf.h> diff --git a/crypto/bio/fd.c b/crypto/bio/fd.c index 7d94843a..13833df5 100644 --- a/crypto/bio/fd.c +++ b/crypto/bio/fd.c @@ -63,9 +63,9 @@ #include <unistd.h> #else #include <io.h> -#pragma warning(push, 3) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) #include <windows.h> -#pragma warning(pop) +OPENSSL_MSVC_PRAGMA(warning(pop)) #endif #include <openssl/buf.h> diff --git a/crypto/bio/internal.h b/crypto/bio/internal.h index eb6b26f6..4ec77fad 100644 --- a/crypto/bio/internal.h +++ b/crypto/bio/internal.h @@ -67,9 +67,9 @@ typedef unsigned short u_short; #include <sys/types.h> #include <sys/socket.h> #else -#pragma warning(push, 3) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) #include <winsock2.h> -#pragma warning(pop) +OPENSSL_MSVC_PRAGMA(warning(pop)) typedef int socklen_t; #endif diff --git a/crypto/bio/socket.c b/crypto/bio/socket.c index 3ef69674..0520c3e8 100644 --- a/crypto/bio/socket.c +++ b/crypto/bio/socket.c @@ -63,9 +63,9 @@ #if !defined(OPENSSL_WINDOWS) #include <unistd.h> #else -#pragma warning(push, 3) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) #include <winsock2.h> -#pragma warning(pop) +OPENSSL_MSVC_PRAGMA(warning(pop)) #pragma comment(lib, "Ws2_32.lib") #endif diff --git a/crypto/bio/socket_helper.c b/crypto/bio/socket_helper.c index 4ddc094d..95007884 100644 --- a/crypto/bio/socket_helper.c +++ b/crypto/bio/socket_helper.c @@ -26,10 +26,10 @@ #include <netdb.h> #include <unistd.h> #else -#pragma warning(push, 3) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) #include <winsock2.h> #include <ws2tcpip.h> -#pragma warning(pop) +OPENSSL_MSVC_PRAGMA(warning(pop)) #endif #include "internal.h" |