diff --git a/CMakeLists.txt b/CMakeLists.txt index cdd8eafb5..29d66c75d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,9 +155,7 @@ endif(CMAKE_SYSTEM MATCHES "SunOS") if (CMAKE_COMPILER_IS_MINGW) add_definitions(-DWC_NO_BEST_FIT_CHARS=0x400 -DPOCO_WIN32_UTF8) - add_definitions(-mno-cygwin -D_WIN32 -DMINGW32 -DWINVER=0x500 -DODBCVER=0x0300 -DPOCO_THREAD_STACK_SIZE -DFoundation_Config_INCLUDED ) - link_directories(/usr/local/lib /usr/lib) - include_directories(/usr/local/include /usr/include) + add_definitions(-D_WIN32 -DMINGW32 -DWINVER=0x500 -DODBCVER=0x0300 -DPOCO_THREAD_STACK_SIZE) endif (CMAKE_COMPILER_IS_MINGW) if (CYGWIN) diff --git a/Foundation/Makefile b/Foundation/Makefile index 627c664a0..45ade1c0c 100644 --- a/Foundation/Makefile +++ b/Foundation/Makefile @@ -61,7 +61,7 @@ target_version = $(LIBVERSION) target_libs = ifeq ($(findstring MinGW, $(POCO_CONFIG)), MinGW) - $(shell cd src; windmc pocomsg.mc) + $(shell cd src; $(WINDMC) pocomsg.mc) endif include $(POCO_BASE)/build/rules/lib diff --git a/Foundation/include/Poco/Bugcheck.h b/Foundation/include/Poco/Bugcheck.h index 904200fc2..ede6f1924 100644 --- a/Foundation/include/Poco/Bugcheck.h +++ b/Foundation/include/Poco/Bugcheck.h @@ -148,7 +148,9 @@ protected: // -GCC_DIAG_OFF(unused-local-typedefs) // supress numerous gcc warnings +#if defined(GNUC) && (GNUC > 4) && (GNUC_MINOR > 6) + GCC_DIAG_OFF(unused-local-typedefs) // supress numerous gcc warnings +#endif // (GNUC) && (GNUC > 4) && (GNUC_MINOR > 6) template diff --git a/Foundation/include/Poco/FPEnvironment_WIN32.h b/Foundation/include/Poco/FPEnvironment_WIN32.h index 33310289b..79a9fb16f 100644 --- a/Foundation/include/Poco/FPEnvironment_WIN32.h +++ b/Foundation/include/Poco/FPEnvironment_WIN32.h @@ -24,6 +24,25 @@ #include #include +#ifndef _SW_INEXACT +# define _SW_INEXACT 0x00000001 // inexact (precision) +#endif +#ifndef _SW_UNDERFLOW +# define _SW_UNDERFLOW 0x00000002 // underflow +#endif +#ifndef _SW_OVERFLOW +# define _SW_OVERFLOW 0x00000004 // overflow +#endif +#ifndef _SW_ZERODIVIDE +# define _SW_ZERODIVIDE 0x00000008 // zero divide +#endif +#ifndef _SW_INVALID +# define _SW_INVALID 0x00000010 // invalid +#endif +#ifndef _SW_DENORMAL +# define _SW_DENORMAL 0x00080000 // denormal status bit +#endif + namespace Poco { @@ -33,24 +52,24 @@ class Foundation_API FPEnvironmentImpl protected: enum RoundingModeImpl { - FP_ROUND_DOWNWARD_IMPL = RC_DOWN, - FP_ROUND_UPWARD_IMPL = RC_UP, - FP_ROUND_TONEAREST_IMPL = RC_NEAR, - FP_ROUND_TOWARDZERO_IMPL = RC_CHOP + FP_ROUND_DOWNWARD_IMPL = _RC_DOWN, + FP_ROUND_UPWARD_IMPL = _RC_UP, + FP_ROUND_TONEAREST_IMPL = _RC_NEAR, + FP_ROUND_TOWARDZERO_IMPL = _RC_CHOP }; enum FlagImpl { - FP_DIVIDE_BY_ZERO_IMPL = SW_ZERODIVIDE, - FP_INEXACT_IMPL = SW_INEXACT, - FP_OVERFLOW_IMPL = SW_OVERFLOW, - FP_UNDERFLOW_IMPL = SW_UNDERFLOW, - FP_INVALID_IMPL = SW_INVALID + FP_DIVIDE_BY_ZERO_IMPL = _SW_ZERODIVIDE, + FP_INEXACT_IMPL = _SW_INEXACT, + FP_OVERFLOW_IMPL = _SW_OVERFLOW, + FP_UNDERFLOW_IMPL = _SW_UNDERFLOW, + FP_INVALID_IMPL = _SW_INVALID }; FPEnvironmentImpl(); FPEnvironmentImpl(const FPEnvironmentImpl& env); ~FPEnvironmentImpl(); FPEnvironmentImpl& operator = (const FPEnvironmentImpl& env); - void keepCurrentImpl(); + void keepCurrentImpl(); static void clearFlagsImpl(); static bool isFlagImpl(FlagImpl flag); static void setRoundingModeImpl(RoundingModeImpl mode); diff --git a/Foundation/src/Environment_WIN32.cpp b/Foundation/src/Environment_WIN32.cpp index 7c96a8da9..b0584eb49 100644 --- a/Foundation/src/Environment_WIN32.cpp +++ b/Foundation/src/Environment_WIN32.cpp @@ -19,6 +19,8 @@ #include #include #include "Poco/UnWindows.h" +#include +#include #include diff --git a/Foundation/src/Environment_WIN32U.cpp b/Foundation/src/Environment_WIN32U.cpp index c82699ad5..65fed1e62 100644 --- a/Foundation/src/Environment_WIN32U.cpp +++ b/Foundation/src/Environment_WIN32U.cpp @@ -21,6 +21,8 @@ #include #include #include "Poco/UnWindows.h" +#include +#include #include diff --git a/Foundation/src/FPEnvironment_WIN32.cpp b/Foundation/src/FPEnvironment_WIN32.cpp index ebbb763e2..9f51b69c7 100644 --- a/Foundation/src/FPEnvironment_WIN32.cpp +++ b/Foundation/src/FPEnvironment_WIN32.cpp @@ -34,7 +34,7 @@ FPEnvironmentImpl::FPEnvironmentImpl(const FPEnvironmentImpl& env) FPEnvironmentImpl::~FPEnvironmentImpl() { - _controlfp(_env, MCW_RC); + _controlfp(_env, _MCW_RC); } @@ -65,13 +65,13 @@ bool FPEnvironmentImpl::isFlagImpl(FlagImpl flag) void FPEnvironmentImpl::setRoundingModeImpl(RoundingModeImpl mode) { - _controlfp(mode, MCW_RC); + _controlfp(mode, _MCW_RC); } FPEnvironmentImpl::RoundingModeImpl FPEnvironmentImpl::getRoundingModeImpl() { - return RoundingModeImpl(_controlfp(0, 0) & MCW_RC); + return RoundingModeImpl(_controlfp(0, 0) & _MCW_RC); } diff --git a/Foundation/src/File_WIN32.cpp b/Foundation/src/File_WIN32.cpp index 202152d7f..4d4ae343e 100644 --- a/Foundation/src/File_WIN32.cpp +++ b/Foundation/src/File_WIN32.cpp @@ -92,7 +92,7 @@ bool FileImpl::existsImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) { switch (GetLastError()) { @@ -114,7 +114,7 @@ bool FileImpl::canReadImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) { switch (GetLastError()) { @@ -133,7 +133,7 @@ bool FileImpl::canWriteImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) handleLastErrorImpl(_path); return (attr & FILE_ATTRIBUTE_READONLY) == 0; } @@ -157,7 +157,7 @@ bool FileImpl::isDirectoryImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) handleLastErrorImpl(_path); return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0; } @@ -190,7 +190,7 @@ bool FileImpl::isHiddenImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) handleLastErrorImpl(_path); return (attr & FILE_ATTRIBUTE_HIDDEN) != 0; } @@ -255,7 +255,7 @@ void FileImpl::setSizeImpl(FileSizeImpl size) FileHandle fh(_path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); LARGE_INTEGER li; li.QuadPart = size; - if (SetFilePointer(fh.get(), li.LowPart, &li.HighPart, FILE_BEGIN) == -1) + if (SetFilePointer(fh.get(), li.LowPart, &li.HighPart, FILE_BEGIN) == INVALID_SET_FILE_POINTER) handleLastErrorImpl(_path); if (SetEndOfFile(fh.get()) == 0) handleLastErrorImpl(_path); diff --git a/Foundation/src/File_WIN32U.cpp b/Foundation/src/File_WIN32U.cpp index 0c2a053e8..80d340305 100644 --- a/Foundation/src/File_WIN32U.cpp +++ b/Foundation/src/File_WIN32U.cpp @@ -96,7 +96,7 @@ bool FileImpl::existsImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) { switch (GetLastError()) { @@ -118,7 +118,7 @@ bool FileImpl::canReadImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) { switch (GetLastError()) { @@ -137,7 +137,7 @@ bool FileImpl::canWriteImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) handleLastErrorImpl(_path); return (attr & FILE_ATTRIBUTE_READONLY) == 0; } @@ -161,7 +161,7 @@ bool FileImpl::isDirectoryImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) handleLastErrorImpl(_path); return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0; } @@ -194,7 +194,7 @@ bool FileImpl::isHiddenImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) handleLastErrorImpl(_path); return (attr & FILE_ATTRIBUTE_HIDDEN) != 0; } @@ -259,7 +259,7 @@ void FileImpl::setSizeImpl(FileSizeImpl size) FileHandle fh(_path, _upath, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); LARGE_INTEGER li; li.QuadPart = size; - if (SetFilePointer(fh.get(), li.LowPart, &li.HighPart, FILE_BEGIN) == -1) + if (SetFilePointer(fh.get(), li.LowPart, &li.HighPart, FILE_BEGIN) == INVALID_SET_FILE_POINTER) handleLastErrorImpl(_path); if (SetEndOfFile(fh.get()) == 0) handleLastErrorImpl(_path); diff --git a/Foundation/src/File_WINCE.cpp b/Foundation/src/File_WINCE.cpp index 4d0f0cf9f..61ab5d671 100644 --- a/Foundation/src/File_WINCE.cpp +++ b/Foundation/src/File_WINCE.cpp @@ -97,7 +97,7 @@ bool FileImpl::existsImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) { switch (GetLastError()) { @@ -119,7 +119,7 @@ bool FileImpl::canReadImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) { switch (GetLastError()) { @@ -138,7 +138,7 @@ bool FileImpl::canWriteImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) handleLastErrorImpl(_path); return (attr & FILE_ATTRIBUTE_READONLY) == 0; } @@ -162,7 +162,7 @@ bool FileImpl::isDirectoryImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) handleLastErrorImpl(_path); return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0; } @@ -185,7 +185,7 @@ bool FileImpl::isHiddenImpl() const poco_assert (!_path.empty()); DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == 0xFFFFFFFF) + if (attr == INVALID_FILE_ATTRIBUTES) handleLastErrorImpl(_path); return (attr & FILE_ATTRIBUTE_HIDDEN) != 0; } @@ -250,7 +250,7 @@ void FileImpl::setSizeImpl(FileSizeImpl size) FileHandle fh(_path, _upath, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); LARGE_INTEGER li; li.QuadPart = size; - if (SetFilePointer(fh.get(), li.LowPart, &li.HighPart, FILE_BEGIN) == -1) + if (SetFilePointer(fh.get(), li.LowPart, &li.HighPart, FILE_BEGIN) == INVALID_SET_FILE_POINTER) handleLastErrorImpl(_path); if (SetEndOfFile(fh.get()) == 0) handleLastErrorImpl(_path); diff --git a/Foundation/testsuite/TestSuite_vs120.vcxproj.filters b/Foundation/testsuite/TestSuite_vs120.vcxproj.filters index 3d476fd48..e933b5a4e 100644 --- a/Foundation/testsuite/TestSuite_vs120.vcxproj.filters +++ b/Foundation/testsuite/TestSuite_vs120.vcxproj.filters @@ -585,7 +585,9 @@ _Driver\Source Files - + + Crypt\Source Files + @@ -990,6 +992,8 @@ Streams\Header Files - + + Crypt\Header Files + \ No newline at end of file diff --git a/Net/samples/httpget/src/httpget.cpp b/Net/samples/httpget/src/httpget.cpp index dc4a4d444..3e6edd047 100644 --- a/Net/samples/httpget/src/httpget.cpp +++ b/Net/samples/httpget/src/httpget.cpp @@ -69,17 +69,17 @@ int main(int argc, char** argv) std::string path(uri.getPathAndQuery()); if (path.empty()) path = "/"; - std::string username; - std::string password; - Poco::Net::HTTPCredentials::extractCredentials(uri, username, password); - Poco::Net::HTTPCredentials credentials(username, password); + std::string username; + std::string password; + Poco::Net::HTTPCredentials::extractCredentials(uri, username, password); + Poco::Net::HTTPCredentials credentials(username, password); HTTPClientSession session(uri.getHost(), uri.getPort()); HTTPRequest request(HTTPRequest::HTTP_GET, path, HTTPMessage::HTTP_1_1); HTTPResponse response; if (!doRequest(session, request, response)) { - credentials.authenticate(request, response); + credentials.authenticate(request, response); if (!doRequest(session, request, response)) { std::cerr << "Invalid username or password" << std::endl; diff --git a/Net/src/NetworkInterface.cpp b/Net/src/NetworkInterface.cpp index bc5221340..e8140afec 100644 --- a/Net/src/NetworkInterface.cpp +++ b/Net/src/NetworkInterface.cpp @@ -30,6 +30,7 @@ #include "Poco/UnicodeConverter.h" #endif #include "Poco/Error.h" + #include #include #include #endif @@ -37,7 +38,6 @@ #include #include - using Poco::NumberFormatter; using Poco::FastMutex; using Poco::format; diff --git a/build/config/MinGW b/build/config/MinGW index e9e579268..35439203d 100644 --- a/build/config/MinGW +++ b/build/config/MinGW @@ -29,6 +29,7 @@ SHELL = sh RM = rm -rf CP = cp MKDIR = mkdir -p +WINDMC = windmc # # Extension for Shared Libraries diff --git a/build/config/MinGW-CrossEnv b/build/config/MinGW-CrossEnv index 4fb68760b..acd9bf38a 100644 --- a/build/config/MinGW-CrossEnv +++ b/build/config/MinGW-CrossEnv @@ -31,6 +31,7 @@ SHELL = sh RM = rm -rf CP = cp MKDIR = mkdir -p +WINDMC = $(CROSSENV)-windmc # # Extension for Shared Libraries