diff --git a/Crypto/src/X509Certificate.cpp b/Crypto/src/X509Certificate.cpp index a7a8ca087..f2263dcfd 100644 --- a/Crypto/src/X509Certificate.cpp +++ b/Crypto/src/X509Certificate.cpp @@ -20,6 +20,10 @@ #include "Poco/DateTimeParser.h" #include #include +#ifdef _WIN32 +// fix for WIN32 header conflict +#undef X509_NAME +#endif #include #include #include diff --git a/Foundation/include/Poco/Error.h b/Foundation/include/Poco/Error.h index 1f96556b8..36f00d19e 100644 --- a/Foundation/include/Poco/Error.h +++ b/Foundation/include/Poco/Error.h @@ -33,10 +33,10 @@ class Foundation_API Error public: #ifdef POCO_OS_FAMILY_WINDOWS - static DWORD last(); + static Poco::UInt32 last(); /// Utility function returning the last error. - static std::string getMessage(DWORD errorCode); + static std::string getMessage(Poco::UInt32 errorCode); /// Utility function translating numeric error code to string. #else static int last(); diff --git a/Foundation/include/Poco/Platform_WIN32.h b/Foundation/include/Poco/Platform_WIN32.h index 67011c0de..a720d918a 100644 --- a/Foundation/include/Poco/Platform_WIN32.h +++ b/Foundation/include/Poco/Platform_WIN32.h @@ -21,115 +21,6 @@ #define Foundation_Platform_WIN32_INCLUDED -#include "Poco/UnWindows.h" - - -#ifndef POCO_FORCE_MIN_WINDOWS_OS_SUPPORT - // Determine the real version. - // This setting can be forced from UnWindows.h - #if defined (_WIN32_WINNT_WINBLUE) - //Windows 8.1 _WIN32_WINNT_WINBLUE (0x0602) - #ifdef _WIN32_WINNT - #undef _WIN32_WINNT - #endif - #define _WIN32_WINNT _WIN32_WINNT_WINBLUE - #ifdef NTDDI_VERSION - #undef NTDDI_VERSION - #endif - #define NTDDI_VERSION NTDDI_WINBLUE - #elif defined (_WIN32_WINNT_WIN8) - //Windows 8 _WIN32_WINNT_WIN8 (0x0602) - #ifdef _WIN32_WINNT - #undef _WIN32_WINNT - #endif - #define _WIN32_WINNT _WIN32_WINNT_WIN8 - #ifdef NTDDI_VERSION - #undef NTDDI_VERSION - #endif - #define NTDDI_VERSION NTDDI_WIN8 - #elif defined (_WIN32_WINNT_WIN7) - //Windows 7 _WIN32_WINNT_WIN7 (0x0601) - #ifdef _WIN32_WINNT - #undef _WIN32_WINNT - #endif - #define _WIN32_WINNT _WIN32_WINNT_WIN7 - #ifdef NTDDI_VERSION - #undef NTDDI_VERSION - #endif - #define NTDDI_VERSION NTDDI_WIN7 - #elif defined (_WIN32_WINNT_WS08) - //Windows Server 2008 _WIN32_WINNT_WS08 (0x0600) - #ifdef _WIN32_WINNT - #undef _WIN32_WINNT - #endif - #define _WIN32_WINNT _WIN32_WINNT_WS08 - #ifdef NTDDI_VERSION - #undef NTDDI_VERSION - #endif - #define NTDDI_VERSION NTDDI_WS08 - #elif defined (_WIN32_WINNT_VISTA) - //Windows Vista _WIN32_WINNT_VISTA (0x0600) - #ifdef _WIN32_WINNT - #undef _WIN32_WINNT - #endif - #define _WIN32_WINNT _WIN32_WINNT_VISTA - #ifdef NTDDI_VERSION - #undef NTDDI_VERSION - #endif - #define NTDDI_VERSION NTDDI_VISTA - #elif defined (_WIN32_WINNT_LONGHORN) - //Windows Vista and server 2008 Development _WIN32_WINNT_LONGHORN (0x0600) - #ifdef _WIN32_WINNT - #undef _WIN32_WINNT - #endif - #define _WIN32_WINNT _WIN32_WINNT_LONGHORN - #ifdef NTDDI_VERSION - #undef NTDDI_VERSION - #endif - #define NTDDI_VERSION 0x06000000 // hardcoded, VS90 can't find NTDDI_* macros - #elif defined (_WIN32_WINNT_WS03) - //Windows Server 2003 with SP1, - //Windows XP with SP2 _WIN32_WINNT_WS03 (0x0502) - #ifdef _WIN32_WINNT - #undef _WIN32_WINNT - #endif - #define _WIN32_WINNT _WIN32_WINNT_WS03 - #ifdef NTDDI_VERSION - #undef NTDDI_VERSION - #endif - #define NTDDI_VERSION NTDDI_WS03 - #elif defined (_WIN32_WINNT_WINXP) - //Windows Server 2003, Windows XP _WIN32_WINNT_WINXP (0x0501) - #ifdef _WIN32_WINNT - #undef _WIN32_WINNT - #endif - #define _WIN32_WINNT _WIN32_WINNT_WINXP - #ifdef NTDDI_VERSION - #undef NTDDI_VERSION - #endif - #define NTDDI_VERSION NTDDI_WINXP - #elif defined (_WIN32_WINNT_WIN2K) - //Windows 2000 _WIN32_WINNT_WIN2K (0x0500) - #ifdef _WIN32_WINNT - #undef _WIN32_WINNT - #endif - #define _WIN32_WINNT _WIN32_WINNT_WIN2K - #elif defined (WINVER) - // fail back on WINVER - #ifdef _WIN32_WINNT - #undef _WIN32_WINNT - #endif - #define _WIN32_WINNT WINVER - #elif !defined(_WIN32_WINNT) - // last resort = Win XP, SP1 is minimum supported - #define _WIN32_WINNT 0x0501 - #ifdef NTDDI_VERSION - #undef NTDDI_VERSION - #endif - #define NTDDI_VERSION 0x05010100 - #endif -#endif // POCO_FORCE_MIN_WINDOWS_OS_SUPPORT - #if defined(_MSC_VER) && !defined(POCO_MSVC_SECURE_WARNINGS) && !defined(_CRT_SECURE_NO_DEPRECATE) #define _CRT_SECURE_NO_DEPRECATE #endif diff --git a/Foundation/include/Poco/Platform_WIN32_OSVER.h b/Foundation/include/Poco/Platform_WIN32_OSVER.h new file mode 100644 index 000000000..73cdd3e34 --- /dev/null +++ b/Foundation/include/Poco/Platform_WIN32_OSVER.h @@ -0,0 +1,134 @@ +// +// Platform_WIN32_OSVER.h +// +// $Id: //poco/1.4/Foundation/include/Poco/Platform_WIN32_OSVER.h#2 $ +// +// Library: Foundation +// Package: Core +// Module: Platform +// +// Platform and architecture identification macros +// and platform-specific definitions for Windows. +// +// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Foundation_Platform_WIN32_OSVER_INCLUDED +#define Foundation_Platform_WIN32_OSVER_INCLUDED + + +#include "Poco/UnWindows.h" + + +#ifndef POCO_FORCE_MIN_WINDOWS_OS_SUPPORT + // Determine the real version. + // This setting can be forced from UnWindows.h + #if defined (_WIN32_WINNT_WINBLUE) + //Windows 8.1 _WIN32_WINNT_WINBLUE (0x0602) + #ifdef _WIN32_WINNT + #undef _WIN32_WINNT + #endif + #define _WIN32_WINNT _WIN32_WINNT_WINBLUE + #ifdef NTDDI_VERSION + #undef NTDDI_VERSION + #endif + #define NTDDI_VERSION NTDDI_WINBLUE + #elif defined (_WIN32_WINNT_WIN8) + //Windows 8 _WIN32_WINNT_WIN8 (0x0602) + #ifdef _WIN32_WINNT + #undef _WIN32_WINNT + #endif + #define _WIN32_WINNT _WIN32_WINNT_WIN8 + #ifdef NTDDI_VERSION + #undef NTDDI_VERSION + #endif + #define NTDDI_VERSION NTDDI_WIN8 + #elif defined (_WIN32_WINNT_WIN7) + //Windows 7 _WIN32_WINNT_WIN7 (0x0601) + #ifdef _WIN32_WINNT + #undef _WIN32_WINNT + #endif + #define _WIN32_WINNT _WIN32_WINNT_WIN7 + #ifdef NTDDI_VERSION + #undef NTDDI_VERSION + #endif + #define NTDDI_VERSION NTDDI_WIN7 + #elif defined (_WIN32_WINNT_WS08) + //Windows Server 2008 _WIN32_WINNT_WS08 (0x0600) + #ifdef _WIN32_WINNT + #undef _WIN32_WINNT + #endif + #define _WIN32_WINNT _WIN32_WINNT_WS08 + #ifdef NTDDI_VERSION + #undef NTDDI_VERSION + #endif + #define NTDDI_VERSION NTDDI_WS08 + #elif defined (_WIN32_WINNT_VISTA) + //Windows Vista _WIN32_WINNT_VISTA (0x0600) + #ifdef _WIN32_WINNT + #undef _WIN32_WINNT + #endif + #define _WIN32_WINNT _WIN32_WINNT_VISTA + #ifdef NTDDI_VERSION + #undef NTDDI_VERSION + #endif + #define NTDDI_VERSION NTDDI_VISTA + #elif defined (_WIN32_WINNT_LONGHORN) + //Windows Vista and server 2008 Development _WIN32_WINNT_LONGHORN (0x0600) + #ifdef _WIN32_WINNT + #undef _WIN32_WINNT + #endif + #define _WIN32_WINNT _WIN32_WINNT_LONGHORN + #ifdef NTDDI_VERSION + #undef NTDDI_VERSION + #endif + #define NTDDI_VERSION 0x06000000 // hardcoded, VS90 can't find NTDDI_* macros + #elif defined (_WIN32_WINNT_WS03) + //Windows Server 2003 with SP1, + //Windows XP with SP2 _WIN32_WINNT_WS03 (0x0502) + #ifdef _WIN32_WINNT + #undef _WIN32_WINNT + #endif + #define _WIN32_WINNT _WIN32_WINNT_WS03 + #ifdef NTDDI_VERSION + #undef NTDDI_VERSION + #endif + #define NTDDI_VERSION NTDDI_WS03 + #elif defined (_WIN32_WINNT_WINXP) + //Windows Server 2003, Windows XP _WIN32_WINNT_WINXP (0x0501) + #ifdef _WIN32_WINNT + #undef _WIN32_WINNT + #endif + #define _WIN32_WINNT _WIN32_WINNT_WINXP + #ifdef NTDDI_VERSION + #undef NTDDI_VERSION + #endif + #define NTDDI_VERSION NTDDI_WINXP + #elif defined (_WIN32_WINNT_WIN2K) + //Windows 2000 _WIN32_WINNT_WIN2K (0x0500) + #ifdef _WIN32_WINNT + #undef _WIN32_WINNT + #endif + #define _WIN32_WINNT _WIN32_WINNT_WIN2K + #elif defined (WINVER) + // fail back on WINVER + #ifdef _WIN32_WINNT + #undef _WIN32_WINNT + #endif + #define _WIN32_WINNT WINVER + #elif !defined(_WIN32_WINNT) + // last resort = Win XP, SP1 is minimum supported + #define _WIN32_WINNT 0x0501 + #ifdef NTDDI_VERSION + #undef NTDDI_VERSION + #endif + #define NTDDI_VERSION 0x05010100 + #endif +#endif // POCO_FORCE_MIN_WINDOWS_OS_SUPPORT + + +#endif // Foundation_Platform_WIN32_OSVER_INCLUDED diff --git a/Foundation/include/Poco/SharedMemory_WIN32.h b/Foundation/include/Poco/SharedMemory_WIN32.h index 79e0bbcd3..3f9efa692 100644 --- a/Foundation/include/Poco/SharedMemory_WIN32.h +++ b/Foundation/include/Poco/SharedMemory_WIN32.h @@ -23,7 +23,7 @@ #include "Poco/Poco.h" #include "Poco/SharedMemory.h" #include "Poco/RefCountedObject.h" - +#include "Poco/UnWindows.h" namespace Poco { diff --git a/Foundation/src/DirectoryWatcher.cpp b/Foundation/src/DirectoryWatcher.cpp index 10a07368a..12149ea4a 100644 --- a/Foundation/src/DirectoryWatcher.cpp +++ b/Foundation/src/DirectoryWatcher.cpp @@ -15,6 +15,9 @@ #include "Poco/DirectoryWatcher.h" +#ifdef POCO_OS_FAMILY_WINDOWS +#include "Poco/UnWindows.h" +#endif #ifndef POCO_NO_INOTIFY diff --git a/Foundation/src/Error.cpp b/Foundation/src/Error.cpp index a37375be1..6a8afb705 100644 --- a/Foundation/src/Error.cpp +++ b/Foundation/src/Error.cpp @@ -17,6 +17,9 @@ #include "Poco/Foundation.h" #include "Poco/UnicodeConverter.h" #include "Poco/Error.h" +#ifdef POCO_OS_FAMILY_WINDOWS +#include "Poco/UnWindows.h" +#endif #include #include #include @@ -26,13 +29,13 @@ namespace Poco { #ifdef POCO_OS_FAMILY_WINDOWS - DWORD Error::last() + Poco::UInt32 Error::last() { return GetLastError(); } - std::string Error::getMessage(DWORD errorCode) + std::string Error::getMessage(Poco::UInt32 errorCode) { std::string errMsg; DWORD dwFlg = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS; diff --git a/Foundation/src/Timestamp.cpp b/Foundation/src/Timestamp.cpp index e386ad309..b547be10b 100644 --- a/Foundation/src/Timestamp.cpp +++ b/Foundation/src/Timestamp.cpp @@ -17,6 +17,12 @@ #include "Poco/Timestamp.h" #include "Poco/Timespan.h" #include "Poco/Exception.h" +#if defined(POCO_OS_FAMILY_WINDOWS) +#include "Poco/UnWindows.h" +#if defined(_WIN32_WCE) +#include +#endif +#endif #include #undef min #undef max @@ -30,11 +36,6 @@ #include #include #endif -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "Poco/UnWindows.h" -#if defined(_WIN32_WCE) -#include -#endif #endif diff --git a/Net/src/NetworkInterface.cpp b/Net/src/NetworkInterface.cpp index 1997e6e51..e84b49d3b 100644 --- a/Net/src/NetworkInterface.cpp +++ b/Net/src/NetworkInterface.cpp @@ -26,6 +26,7 @@ #include "Poco/RefCountedObject.h" #include "Poco/Format.h" #if defined(POCO_OS_FAMILY_WINDOWS) + #include "Poco/Platform_WIN32_OSVER.h" #if defined(POCO_WIN32_UTF8) #include "Poco/UnicodeConverter.h" #endif diff --git a/NetSSL_Win/include/Poco/Net/X509Certificate.h b/NetSSL_Win/include/Poco/Net/X509Certificate.h index fe0a0208b..26629b3b2 100644 --- a/NetSSL_Win/include/Poco/Net/X509Certificate.h +++ b/NetSSL_Win/include/Poco/Net/X509Certificate.h @@ -24,6 +24,7 @@ #include "Poco/DateTime.h" #include #include +#include #include diff --git a/Util/include/Poco/Util/WinRegistryConfiguration.h b/Util/include/Poco/Util/WinRegistryConfiguration.h index 64bc8cc7f..1d3f879b9 100644 --- a/Util/include/Poco/Util/WinRegistryConfiguration.h +++ b/Util/include/Poco/Util/WinRegistryConfiguration.h @@ -23,6 +23,7 @@ #include "Poco/Util/Util.h" #include "Poco/Util/AbstractConfiguration.h" #include "Poco/String.h" +#include "Poco/UnWindows.h" namespace Poco {