diff --git a/socketft.cpp b/socketft.cpp index 7ef40f76..278f5b45 100644 --- a/socketft.cpp +++ b/socketft.cpp @@ -1,6 +1,7 @@ // socketft.cpp - written and placed in the public domain by Wei Dai #include "pch.h" +#define _WINSOCK_DEPRECATED_NO_WARNINGS #include "socketft.h" #include "trap.h" 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 #include "winpipes.h" + +#if (_MSC_VER) +# pragma warning (pop) +#endif + #else + #include #include #include #include + #endif NAMESPACE_BEGIN(CryptoPP) diff --git a/winpipes.h b/winpipes.h index 43965c40..546c8a34 100644 --- a/winpipes.h +++ b/winpipes.h @@ -9,8 +9,19 @@ #include "queue.h" #include "trap.h" +// Using _WINSOCK_DEPRECATED_NO_WARNINGS disables warnings for application code, too +#if (_MSC_VER) +# pragma warning (push) +# pragma warning (disable: 4996) +#endif + #include +// Using _WINSOCK_DEPRECATED_NO_WARNINGS disables warnings for application code, too +#if (_MSC_VER) +# pragma warning (pop) +#endif + NAMESPACE_BEGIN(CryptoPP) //! Windows Handle