diff --git a/socketft.h b/socketft.h index 6bbd1d3f..4b2a68d7 100644 --- a/socketft.h +++ b/socketft.h @@ -5,36 +5,27 @@ #ifdef SOCKETS_AVAILABLE -#include "network.h" -#include "queue.h" -#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 - -// Using _WINSOCK_DEPRECATED_NO_WARNINGS disables warnings for application code, too +// Avoid _WINSOCK_DEPRECATED_NO_WARNINGS #if (_MSC_VER) # pragma warning (push) # pragma warning (disable: 4996) #endif +#include "network.h" +#include "queue.h" +#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 #include #include "winpipes.h" - -#if (_MSC_VER) -# pragma warning (pop) -#endif - #else - #include #include #include #include - #endif NAMESPACE_BEGIN(CryptoPP) @@ -235,6 +226,11 @@ private: NAMESPACE_END +// Avoid _WINSOCK_DEPRECATED_NO_WARNINGS +#if (_MSC_VER) +# pragma warning (pop) +#endif + #endif // #ifdef SOCKETS_AVAILABLE #endif diff --git a/winpipes.h b/winpipes.h index 546c8a34..ea8ef1e6 100644 --- a/winpipes.h +++ b/winpipes.h @@ -5,22 +5,17 @@ #ifdef WINDOWS_PIPES_AVAILABLE -#include "network.h" -#include "queue.h" -#include "trap.h" - -// Using _WINSOCK_DEPRECATED_NO_WARNINGS disables warnings for application code, too +// Avoid _WINSOCK_DEPRECATED_NO_WARNINGS #if (_MSC_VER) # pragma warning (push) # pragma warning (disable: 4996) #endif -#include +#include "network.h" +#include "queue.h" +#include "trap.h" -// Using _WINSOCK_DEPRECATED_NO_WARNINGS disables warnings for application code, too -#if (_MSC_VER) -# pragma warning (pop) -#endif +#include NAMESPACE_BEGIN(CryptoPP) @@ -150,6 +145,11 @@ private: NAMESPACE_END +// Avoid _WINSOCK_DEPRECATED_NO_WARNINGS +#if (_MSC_VER) +# pragma warning (pop) +#endif + #endif #endif