Merge pull request #96 from mkrivos/small_fixes

cmake addition and gcc warning fixes
This commit is contained in:
Aleksandar Fabijanic 2013-02-18 23:55:17 -08:00
Родитель c6ac318ac6 9349786415
Коммит a48e7ebb80
10 изменённых файлов: 41 добавлений и 10 удалений

7
.gitignore поставляемый
Просмотреть файл

@ -100,6 +100,13 @@ lib/
lib64/
pocomsg.h
# Eclipse generated files #
######################
.project
.cproject
.settings
cmake-build/
# Temporary files #
###################
*.bak

Просмотреть файл

@ -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")

Просмотреть файл

@ -1,5 +1,6 @@
set( TEST_SRCS
src/CryptoTest.cpp
src/DigestEngineTest.cpp
src/CryptoTestSuite.cpp
src/Driver.cpp
src/RSATest.cpp

Просмотреть файл

@ -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

Просмотреть файл

@ -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 \

Просмотреть файл

@ -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;

Просмотреть файл

@ -38,6 +38,7 @@
#include "Poco/UnicodeConverter.h"
#include "Poco/Error.h"
#include <string>
#include <string.h>
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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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