From e1c7bc55dd124d39e57a2bae3dce4b1af7499f09 Mon Sep 17 00:00:00 2001 From: Aleksandar Fabijanic Date: Mon, 28 Apr 2008 21:52:10 +0000 Subject: [PATCH] SF items 1951604 and 1953551 [1951604] POCO refuses to compile with g++ 4.3.0 [1953551] Solaris Sun Studio 12 Apache stdcxx 64 bit Warning: compile with target platforms not done yet! --- .../ODBC/include/Poco/Data/ODBC/Diagnostics.h | 1 + Foundation/include/Poco/HashTable.h | 5 +- Foundation/src/BinaryWriter.cpp | 1 + Foundation/src/File_UNIX.cpp | 1 + Foundation/src/Format.cpp | 1 + Foundation/src/Thread_POSIX.cpp | 5 ++ Foundation/testsuite/src/ThreadTest.cpp | 5 ++ build/config/SunOS-stdcxx-x86_64 | 70 +++++++++++++++++++ 8 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 build/config/SunOS-stdcxx-x86_64 diff --git a/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h b/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h index eae96babf..33a0e72ff 100644 --- a/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h +++ b/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h @@ -42,6 +42,7 @@ #include "Poco/Data/ODBC/ODBC.h" #include +#include #ifdef POCO_OS_FAMILY_WINDOWS #include #endif diff --git a/Foundation/include/Poco/HashTable.h b/Foundation/include/Poco/HashTable.h index c73bb4bea..58a5d3f51 100644 --- a/Foundation/include/Poco/HashTable.h +++ b/Foundation/include/Poco/HashTable.h @@ -47,6 +47,7 @@ #include #include #include +#include namespace Poco { @@ -79,7 +80,7 @@ public: /// Creates the HashTable. { _entries = new HashEntryMap*[initialSize]; - memset(_entries, '\0', sizeof(HashEntryMap*)*initialSize); + std::memset(_entries, '\0', sizeof(HashEntryMap*)*initialSize); } HashTable(const HashTable& ht): @@ -314,7 +315,7 @@ public: UInt32 oldSize = _maxCapacity; _maxCapacity = newSize; _entries = new HashEntryMap*[_maxCapacity]; - memset(_entries, '\0', sizeof(HashEntryMap*)*_maxCapacity); + std::memset(_entries, '\0', sizeof(HashEntryMap*)*_maxCapacity); if (_size == 0) { diff --git a/Foundation/src/BinaryWriter.cpp b/Foundation/src/BinaryWriter.cpp index 8d0e482c9..a7ed95779 100644 --- a/Foundation/src/BinaryWriter.cpp +++ b/Foundation/src/BinaryWriter.cpp @@ -36,6 +36,7 @@ #include "Poco/BinaryWriter.h" #include "Poco/ByteOrder.h" +#include namespace Poco { diff --git a/Foundation/src/File_UNIX.cpp b/Foundation/src/File_UNIX.cpp index 53c01785c..595ed6211 100644 --- a/Foundation/src/File_UNIX.cpp +++ b/Foundation/src/File_UNIX.cpp @@ -38,6 +38,7 @@ #include "Poco/Buffer.h" #include "Poco/Exception.h" #include +#include #include #include #include diff --git a/Foundation/src/Format.cpp b/Foundation/src/Format.cpp index 5e7cfcd0a..9fc647040 100644 --- a/Foundation/src/Format.cpp +++ b/Foundation/src/Format.cpp @@ -49,6 +49,7 @@ #include "Poco/Format.h" #include "Poco/Exception.h" +#include #include #include #include diff --git a/Foundation/src/Thread_POSIX.cpp b/Foundation/src/Thread_POSIX.cpp index cb4b90296..af3f826cb 100644 --- a/Foundation/src/Thread_POSIX.cpp +++ b/Foundation/src/Thread_POSIX.cpp @@ -38,6 +38,11 @@ #include "Poco/Exception.h" #include "Poco/ErrorHandler.h" #include +#if defined(__sun) && defined(__SVR4) +#define __EXTENSIONS__ +#include +#endif + // // Block SIGPIPE in main thread. diff --git a/Foundation/testsuite/src/ThreadTest.cpp b/Foundation/testsuite/src/ThreadTest.cpp index 1fac39049..37d00d136 100644 --- a/Foundation/testsuite/src/ThreadTest.cpp +++ b/Foundation/testsuite/src/ThreadTest.cpp @@ -38,6 +38,11 @@ #include "Poco/ThreadTarget.h" #include "Poco/Event.h" #include +#if defined(__sun) && defined(__SVR4) +#define __EXTENSIONS__ +#include +#endif + using Poco::Thread; using Poco::Runnable; diff --git a/build/config/SunOS-stdcxx-x86_64 b/build/config/SunOS-stdcxx-x86_64 new file mode 100644 index 000000000..6e07f2cf5 --- /dev/null +++ b/build/config/SunOS-stdcxx-x86_64 @@ -0,0 +1,70 @@ +# +# $Id: //poco/1.3/build/config/SunOS-stdcxx-x86_64#1 $ +# +# SunOS +# +# Build settings for SunOS 5.10/Sun Studio 12 C++ 5.9/Apache stdcxx/AMD Opteron 64 bit +# + +# +# General Settings +# +LINKMODE = SHARED + +# +# Tools +# +CC = cc -xtarget=opteron -m64 +CXX = CC -xtarget=opteron -m64 -library=no%Cstd +LINK = $(CXX) +LIB = $(CXX) -xar -o $@ +RANLIB = ranlib +SHLIB = $(CXX) $(LINKFLAGS) -G -o $@ -h$(notdir $@) +SHLIBLN = $(POCO_BASE)/build/script/shlibln +STRIP = +DEP = $(POCO_BASE)/build/script/makedepend.SunCC +SHELL = sh +RM = rm -rf +CP = cp +MKDIR = mkdir -p + +# +# Extension for Shared Libraries +# +SHAREDLIBEXT = .so.$(target_version) +SHAREDLIBLINKEXT = .so + +# +# Compiler and Linker Flags +# +CFLAGS = -mt -Isrc +CFLAGS32 = +CFLAGS64 = +CXXFLAGS = -mt -features=tmplife +CXXFLAGS32 = +CXXFLAGS64 = +LINKFLAGS = -mt +LINKFLAGS32 = +LINKFLAGS64 = +STATICOPT_CC = +STATICOPT_CXX = +STATICOPT_LINK = -Bstatic +SHAREDOPT_CC = -KPIC +SHAREDOPT_CXX = -KPIC +SHAREDOPT_LINK = -Bdynamic +DEBUGOPT_CC = -g -xdebugformat=stabs -xs -D_DEBUG=$(DEBUGLEVEL) +DEBUGOPT_CXX = -g -xdebugformat=stabs -xs -D_DEBUG=$(DEBUGLEVEL) +DEBUGOPT_LINK = -g -xdebugformat=stabs -xs +RELEASEOPT_CC = -xO3 -g0 -xregs=no%frameptr -xdebugformat=stabs -xs -DNDEBUG -library=no%Cstd +RELEASEOPT_CXX = -xO3 -g0 -xregs=no%frameptr -xdebugformat=stabs -xs -DNDEBUG -library=no%Cstd +RELEASEOPT_LINK = + +# +# System Specific Flags +# +SYSFLAGS = -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -D_RWSTDDEBUG -D_RWSTD_NO_DEBUG_ITER + +# +# System Specific Libraries +# +SYSLIBS = -lstd15D -lpthread -lrt -lxnet -lsocket -lnsl -lresolv -ldl