diff --git a/.gitignore b/.gitignore index cf52c1cab..44ceff1e2 100644 --- a/.gitignore +++ b/.gitignore @@ -100,6 +100,13 @@ lib/ lib64/ pocomsg.h +# Eclipse generated files # +###################### +.project +.cproject +.settings +cmake-build/ + # Temporary files # ################### *.bak diff --git a/CMakeLists.txt b/CMakeLists.txt index 345fe841f..19adcb1bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ PROJECT(Poco) cmake_minimum_required(VERSION 2.8.0) -set(SHARED_LIBRARY_VERSION "15") +set(SHARED_LIBRARY_VERSION "21") set(CPACK_PACKAGE_VERSION_MAJOR "1") set(CPACK_PACKAGE_VERSION_MINOR "5") @@ -102,8 +102,9 @@ include(FindOpenSSL) #include(CMakeDetermineCompilerId) include(FindMySQL) -include(FindAPR) -include(FindApache2) + +#include(FindAPR) +#include(FindApache2) # OS Detection if(CMAKE_SYSTEM MATCHES "Windows") diff --git a/Crypto/testsuite/CMakeLists.txt b/Crypto/testsuite/CMakeLists.txt index 411bc3379..c7c8fc678 100644 --- a/Crypto/testsuite/CMakeLists.txt +++ b/Crypto/testsuite/CMakeLists.txt @@ -1,5 +1,6 @@ set( TEST_SRCS src/CryptoTest.cpp +src/DigestEngineTest.cpp src/CryptoTestSuite.cpp src/Driver.cpp src/RSATest.cpp diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt index e0f215a7b..5acc97e9b 100644 --- a/Foundation/CMakeLists.txt +++ b/Foundation/CMakeLists.txt @@ -31,6 +31,8 @@ set( BASE_SRCS src/AsyncChannel.cpp src/Base64Decoder.cpp src/Base64Encoder.cpp + src/Base32Decoder.cpp + src/Base32Encoder.cpp src/BinaryReader.cpp src/BinaryWriter.cpp src/Bugcheck.cpp @@ -50,6 +52,7 @@ set( BASE_SRCS src/DigestEngine.cpp src/DigestStream.cpp src/DirectoryIterator.cpp + src/DirectoryWatcher.cpp src/Environment.cpp src/Error.cpp src/ErrorHandler.cpp diff --git a/Foundation/Makefile b/Foundation/Makefile index 9b3c6728c..8e48ebdda 100644 --- a/Foundation/Makefile +++ b/Foundation/Makefile @@ -13,7 +13,7 @@ objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel \ BinaryReader BinaryWriter Bugcheck ByteOrder Channel Checksum Configurable ConsoleChannel \ CountingStream DateTime LocalDateTime DateTimeFormat DateTimeFormatter DateTimeParser \ Debugger DeflatingStream DigestEngine DigestStream DirectoryIterator DirectoryWatcher \ - Environment Event EventArgs ErrorHandler Exception FIFOBufferStream FPEnvironment File \ + Environment Event Error EventArgs ErrorHandler Exception FIFOBufferStream FPEnvironment File \ FileChannel Formatter FormattingChannel Glob HexBinaryDecoder LineEndingConverter \ HexBinaryEncoder InflatingStream Latin1Encoding Latin2Encoding Latin9Encoding LogFile \ Logger LoggingFactory LoggingRegistry LogStream NamedEvent NamedMutex NullChannel \ diff --git a/Foundation/include/Poco/NumericString.h b/Foundation/include/Poco/NumericString.h index e12e26d31..45c865e16 100644 --- a/Foundation/include/Poco/NumericString.h +++ b/Foundation/include/Poco/NumericString.h @@ -349,7 +349,7 @@ bool intToStr(T value, size = ptr - result; poco_assert_dbg (size <= ptr.span()); - poco_assert_dbg ((-1 == width) || (size >= width)); + poco_assert_dbg ((-1 == width) || (size >= size_t(width))); *ptr-- = '\0'; char* ptrr = result; @@ -424,7 +424,7 @@ bool uIntToStr(T value, size = ptr - result; poco_assert_dbg (size <= ptr.span()); - poco_assert_dbg ((-1 == width) || (size >= width)); + poco_assert_dbg ((-1 == width) || (size >= size_t(width))); *ptr-- = '\0'; char* ptrr = result; diff --git a/Foundation/src/Error.cpp b/Foundation/src/Error.cpp index 2f864ecb9..1491f3e5c 100644 --- a/Foundation/src/Error.cpp +++ b/Foundation/src/Error.cpp @@ -38,6 +38,7 @@ #include "Poco/UnicodeConverter.h" #include "Poco/Error.h" #include +#include namespace Poco { @@ -66,9 +67,24 @@ namespace Poco { std::string Error::getMessage(int errorCode) { -#error todo - char errmsg[256]; - return std::string(strerror_r(errorCode, errMsg, 256)); + /* Reentrant version of `strerror'. + There are 2 flavors of `strerror_r', GNU which returns the string + and may or may not use the supplied temporary buffer and POSIX one + which fills the string into the buffer. + To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L + without -D_GNU_SOURCE is needed, otherwise the GNU version is + preferred. + */ +#ifdef _GNU_SOURCE + char errmsg[256] = ""; + return std::string(strerror_r(errorCode, errmsg, 256)); +#elif (_XOPEN_SOURCE >= 600) + char errmsg[256] = ""; + strerror_r(errorCode, errmsg, 256); + return errmsg; +#else + return std::string(strerror(errorCode)); +#endif } #endif diff --git a/Foundation/testsuite/CMakeLists.txt b/Foundation/testsuite/CMakeLists.txt index 5aaf6d72a..8e40c6e6e 100644 --- a/Foundation/testsuite/CMakeLists.txt +++ b/Foundation/testsuite/CMakeLists.txt @@ -6,6 +6,7 @@ src/AnyTest.cpp src/ArrayTest.cpp src/AutoPtrTest.cpp src/AutoReleasePoolTest.cpp +src/Base32Test.cpp src/Base64Test.cpp src/BasicEventTest.cpp src/BinaryReaderWriterTest.cpp @@ -23,6 +24,7 @@ src/DateTimeParserTest.cpp src/DateTimeTest.cpp src/DateTimeTestSuite.cpp src/DigestStreamTest.cpp +src/DirectoryWatcherTest.cpp src/Driver.cpp src/DummyDelegate.cpp src/DynamicFactoryTest.cpp diff --git a/MongoDB/CMakeLists.txt b/MongoDB/CMakeLists.txt index 707eb472b..e00693ddf 100644 --- a/MongoDB/CMakeLists.txt +++ b/MongoDB/CMakeLists.txt @@ -10,7 +10,7 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) set_target_properties( ${LIBNAME} PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} ) -target_link_libraries( ${LIBNAME} PocoFoundation) +target_link_libraries( ${LIBNAME} PocoNet PocoFoundation) install( DIRECTORY include/Poco diff --git a/Net/CMakeLists.txt b/Net/CMakeLists.txt index 38ac6587c..3065a75d5 100644 --- a/Net/CMakeLists.txt +++ b/Net/CMakeLists.txt @@ -49,6 +49,7 @@ set( BASE_SRCS src/ICMPSocketImpl.cpp src/ICMPv4PacketImpl.cpp src/IPAddress.cpp + src/IPAddressImpl.cpp src/MailMessage.cpp src/MailRecipient.cpp src/MailStream.cpp