summaryrefslogtreecommitdiff
path: root/socketft.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-07-27 19:05:53 -0400
committerJeffrey Walton <noloader@gmail.com>2015-07-27 19:05:53 -0400
commit185a2c8e830644a62eaedf21853abb3b7fd1254b (patch)
tree94e6680f71e97bac982be805deecba0d9cb9ad45 /socketft.h
parent383d9636a89fb640cae2276e5a0dc32549744d40 (diff)
downloadcryptopp-git-185a2c8e830644a62eaedf21853abb3b7fd1254b.tar.gz
Used pragmas to disable the deprecated warnings under Visual Studio rather than _WINSOCK_DEPRECATED_NO_WARNINGS. Using _WINSOCK_DEPRECATED_NO_WARNINGS could cross-pollintae out of the library and into user code
Diffstat (limited to 'socketft.h')
-rw-r--r--socketft.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/socketft.h b/socketft.h
index 065a59c8..6bbd1d3f 100644
--- a/socketft.h
+++ b/socketft.h
@@ -10,17 +10,31 @@
#include "trap.h"
#ifdef USE_WINDOWS_STYLE_SOCKETS
+
# if defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_)
# error Winsock 1 is not supported by this library. Please include this file or winsock2.h before windows.h.
# endif
-#define _WINSOCK_DEPRECATED_NO_WARNINGS
+
+// Using _WINSOCK_DEPRECATED_NO_WARNINGS disables warnings for application code, too
+#if (_MSC_VER)
+# pragma warning (push)
+# pragma warning (disable: 4996)
+#endif
+
#include <winsock2.h>
#include "winpipes.h"
+
+#if (_MSC_VER)
+# pragma warning (pop)
+#endif
+
#else
+
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
+
#endif
NAMESPACE_BEGIN(CryptoPP)