diff -NEaur Ice-3.2.0/allTests.py Ice-3.2.0-qnx/allTests.py --- Ice-3.2.0/allTests.py 2007-02-23 19:35:30.000000000 +0100 +++ Ice-3.2.0-qnx/allTests.py 2007-04-20 18:48:39.000000000 +0200 @@ -100,30 +100,30 @@ "Ice/timeout", \ "Ice/servantLocator", \ "Ice/threads", \ - "IceSSL/configuration", \ - "Freeze/dbmap", \ +# "IceSSL/configuration", \ # partially works but we don't care +# "Freeze/dbmap", \ # Dbc::get: Dbt not large enough for available data: DB_BUFFER_SMALL: "Freeze/complex", \ - "Freeze/evictor", \ - "Freeze/oldevictor", \ +# "Freeze/evictor", \ +# "Freeze/oldevictor", \ "IceStorm/single", \ "IceStorm/federation", \ "IceStorm/federation2", \ "IceStorm/stress", \ - "FreezeScript/dbmap", \ - "FreezeScript/evictor", \ - "IceGrid/simple", \ - "IceGrid/deployer", \ - "IceGrid/session", \ - "IceGrid/update", \ - "IceGrid/activation", \ - "IceGrid/replicaGroup", \ - "IceGrid/replication", \ - "IceGrid/allocation", \ - "IceGrid/distribution", \ +# "FreezeScript/dbmap", \ # testing error detection... failed! (1) +# "FreezeScript/evictor", \ # failed! +# "IceGrid/simple", \ # registry works but starting the node fails +# "IceGrid/deployer", \ +# "IceGrid/session", \ +# "IceGrid/update", \ +# "IceGrid/activation", \ +# "IceGrid/replicaGroup", \ +# "IceGrid/replication", \ +# "IceGrid/allocation", \ +# "IceGrid/distribution", \ "Glacier2/router", \ "Glacier2/attack", \ "Glacier2/sessionControl", \ - "Glacier2/ssl", \ +# "Glacier2/ssl", \ "Glacier2/dynamicFiltering", \ "Glacier2/staticFiltering", \ ] diff -NEaur Ice-3.2.0/config/Make.rules Ice-3.2.0-qnx/config/Make.rules --- Ice-3.2.0/config/Make.rules 2007-03-09 00:16:54.000000000 +0100 +++ Ice-3.2.0-qnx/config/Make.rules 2007-04-20 18:48:39.000000000 +0200 @@ -65,7 +65,7 @@ # compiler can find it, set BZIP2_HOME to the bzip2 installation # directory. # -#BZIP2_HOME ?= /opt/bzip2 +BZIP2_HOME = /opt/bzip2 # @@ -73,20 +73,20 @@ # compiler can find it, set DB_HOME to the Berkeley DB installation # directory. # -#DB_HOME ?= /opt/db +DB_HOME = /opt/db # # If expat is not installed in a standard location where the compiler # can find it, set EXPAT_HOME to the expat installation directory. # -#EXPAT_HOME ?= /opt/expat +EXPAT_HOME = /opt/expat # # If OpenSSL is not installed in a standard location where the # compiler can find it, set OPENSSL_HOME to the OpenSSL installation # directory. # -#OPENSSL_HOME ?= /opt/openssl +OPENSSL_HOME = /opt/openssl # # Define if your OpenSSL requires Kerberos, and if Kerberos is not @@ -181,7 +181,7 @@ ifneq ($(DB_HOME),) DB_FLAGS = -I$(DB_HOME)/include - DB_LIBS = -L$(DB_HOME)/$(libsubdir) -ldb_cxx + DB_LIBS = -lsocket -l$(DB_HOME)/$(libsubdir)/libdb_cxx-4.5S.a DB_RPATH_LINK = $(call rpathlink,$(DB_HOME)/$(libsubdir)) else ifeq ($(shell if [ -d /usr/include/db45 -a -d /usr/$(libsubdir)/db45 ] ; then echo yes; fi), yes) diff -NEaur Ice-3.2.0/config/Make.rules.QNX Ice-3.2.0-qnx/config/Make.rules.QNX --- Ice-3.2.0/config/Make.rules.QNX 1970-01-01 01:00:00.000000000 +0100 +++ Ice-3.2.0-qnx/config/Make.rules.QNX 2007-04-20 18:48:39.000000000 +0200 @@ -0,0 +1,158 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +# +# This file is included by Make.rules when uname is Linux. +# + +USE_SPARC_ASM = irrelevant +MACHINE = $(shell uname -m) + +# +# Default compiler is c++ (aka g++). +# +ifeq ($(CXX),) + CXX = QCC +endif + +ifeq ($(CXX),g++) + CXX =QCC +endif + +# +# icecpp is built with a C compiler +# +CFLAGS=-O2 -V3.3.5,gcc_ntox86 -lang-c + +ifeq ($(MACHINE),x86_64) + + ifeq ($(LP64),) + LP64 = yes + endif + ifeq ($(LP64),yes) + CFLAGS += -m64 + else + CFLAGS += -m32 + endif +endif + +ifeq ($(CXX),QCC) + + ifeq ($(MACHINE),sparc64) + # + # We are an ultra, at least, and so have the atomic instructions + # + USE_SPARC_ASM = yes + CXXARCHFLAGS = -mcpu=ultrasparc -pipe -Wno-deprecated -DUSE_SPARC_ASM + endif + + ifeq ($(MACHINE),sparc) + # + # We are a sun4m or sun4c + # On sun4m, there is a bug in some CPU/kernel/gcc configurations which + # prevent us from using '-mcpu=v8' + # + USE_SPARC_ASM = no + CXXARCHFLAGS = -mtune=v8 -pipe -Wno-deprecated -DICE_USE_MUTEX_SHARED + endif + + ifeq ($(MACHINE),x86_64) + ifeq ($(LP64),yes) + CXXARCHFLAGS += -m64 + else + CXXARCHFLAGS += -m32 + endif + lp64suffix = 64 + endif + + CXXFLAGS = $(CXXARCHFLAGS) -ftemplate-depth-128 -Wall -D_REENTRANT -V3.3.5,gcc_ntox86_cpp -fexceptions + + ifeq ($(STATICLIBS),) + #CXXFLAGS += -fPIC + endif + + ifeq ($(OPTIMIZE),yes) + CXXFLAGS += -O2 -DNDEBUG + else + CXXFLAGS += -g + endif + + ifeq ($(USE_SPARC_ASM),yes) + CFLAGS = -O2 -mcpu=ultrasparc -pipe -DNDEBUG -DUSE_SPARC_ASM + ifeq ($(STATICLIBS),) + # CFLAGS += -fPIC + endif + endif + ifeq ($(USE_SPARC_ASM),no) + CFLAGS = -O2 -mcpu=v8 -pipe -DNDEBUG -DICE_USE_MUTEX_SHARED + ifeq ($(STATICLIBS),) + # CFLAGS += -fPIC + endif + endif + + # + # C++ run-time libraries, necessary for linking some shared libraries. + # + CXXLIBS = + + mkshlib = $(CXX) -shared $(LDFLAGS) -o $(1) "-Wl,-h,$(2)" $(3) $(4) + # Note: in QNX pthreads are built into libc.so + + mklib = ar cr $(1) $(2) + + rpathlink = -Wl,-rpath-link,$(1) + + ifneq ($(embedded_runpath_prefix),) + LDPLATFORMFLAGS = "-Wl,--enable-new-dtags" "-Wl,-rpath,$(runpath_libdir)" -lang-c++ -lm + else + LDPLATFORMFLAGS = "-Wl,--enable-new-dtags" -lang-c++ -lm + endif + + CPPPLATFORMLIBFLAGS = -shared + +endif + +ifeq ($(CXX),icpc) + + CXXFLAGS = -D_REENTRANT + + ifeq ($(STATICLIBS),) + CXXFLAGS += -fPIC + endif + + ifeq ($(OPTIMIZE),yes) + CXXFLAGS += -O2 -DNDEBUG + else + CXXFLAGS += -g + endif + + # + # C++ run-time libraries, necessary for linking some shared libraries. + # + CXXLIBS = + + mkshlib = $(CXX) -shared $(LDFLAGS) -o $(1) -Wl,-h,$(2) $(3) $(4) -lpthread + + mklib = ar cr $(1) $(2) + + rpathlink = -Wl,-rpath-link,$(1) + +endif + +BASELIBS = -lIceUtil $(STLPORT_LIBS) +# Note: in QNX pthreads are built into libc.so + +LIBS = $(BZIP2_RPATH_LINK) -lIce $(BASELIBS) + +ICEUTIL_OS_LIBS = +ICE_OS_LIBS = -lsocket + +PLATFORM_HAS_READLINE = yes + +export LD_LIBRARY_PATH := $(libdir):$(LD_LIBRARY_PATH) diff -NEaur Ice-3.2.0/include/Ice/BasicStream.h Ice-3.2.0-qnx/include/Ice/BasicStream.h --- Ice-3.2.0/include/Ice/BasicStream.h 2007-02-01 17:40:28.000000000 +0100 +++ Ice-3.2.0-qnx/include/Ice/BasicStream.h 2007-04-20 18:48:39.000000000 +0200 @@ -18,6 +18,9 @@ #include #include #include +#ifdef __QNX__ +# include // for memcpy() +#endif namespace Ice { diff -NEaur Ice-3.2.0/include/Ice/Config.h Ice-3.2.0-qnx/include/Ice/Config.h --- Ice-3.2.0/include/Ice/Config.h 2007-01-08 20:37:12.000000000 +0100 +++ Ice-3.2.0-qnx/include/Ice/Config.h 2007-04-20 18:48:39.000000000 +0200 @@ -29,6 +29,11 @@ # include #endif +#ifdef __QNX__ +# include // for ptrdiff_t +# include // for free() +#endif + // // Define the Ice and IceInternal namespace, so that we can use the following // everywhere in our code: diff -NEaur Ice-3.2.0/include/IceUtil/Cond.h Ice-3.2.0-qnx/include/IceUtil/Cond.h --- Ice-3.2.0/include/IceUtil/Cond.h 2007-02-01 17:40:28.000000000 +0100 +++ Ice-3.2.0-qnx/include/IceUtil/Cond.h 2007-04-20 18:48:39.000000000 +0200 @@ -116,7 +116,9 @@ friend class Monitor; friend class Monitor; - +#if defined(__QNX__) + friend class RecMutex; +#endif // // The Monitor implementation uses waitImpl & timedWaitImpl. // diff -NEaur Ice-3.2.0/include/IceUtil/Config.h Ice-3.2.0-qnx/include/IceUtil/Config.h --- Ice-3.2.0/include/IceUtil/Config.h 2007-02-28 17:23:54.000000000 +0100 +++ Ice-3.2.0-qnx/include/IceUtil/Config.h 2007-04-20 18:48:39.000000000 +0200 @@ -91,7 +91,7 @@ // TODO: figure out why IceUtil does not compile with _SLTP_DEBUG using // the Intel compiler. // -#if !defined(NDEBUG) && !defined(_STLP_DEBUG) && !defined(__INTEL_COMPILER) && !defined(__BCPLUSPLUS__) +#if !defined(NDEBUG) && !defined(_STLP_DEBUG) && !defined(__INTEL_COMPILER) && !defined(__BCPLUSPLUS__) && !defined(__QNX__) # define _STLP_DEBUG #endif diff -NEaur Ice-3.2.0/include/IceUtil/Mutex.h Ice-3.2.0-qnx/include/IceUtil/Mutex.h --- Ice-3.2.0/include/IceUtil/Mutex.h 2007-02-01 17:40:28.000000000 +0100 +++ Ice-3.2.0-qnx/include/IceUtil/Mutex.h 2007-04-20 18:48:39.000000000 +0200 @@ -95,6 +95,9 @@ void lock(LockState&) const; friend class Cond; +#if defined(__QNX__) + friend class RecMutex; +#endif #ifdef _WIN32 # if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0400 diff -NEaur Ice-3.2.0/include/IceUtil/RecMutex.h Ice-3.2.0-qnx/include/IceUtil/RecMutex.h --- Ice-3.2.0/include/IceUtil/RecMutex.h 2007-02-01 17:40:28.000000000 +0100 +++ Ice-3.2.0-qnx/include/IceUtil/RecMutex.h 2007-04-20 18:48:39.000000000 +0200 @@ -14,6 +14,11 @@ #include #include +#if defined(__QNX__) +# include +# include +#endif + namespace IceUtil { @@ -99,6 +104,11 @@ # else HANDLE _mutex; # endif +#elif defined(__QNX__) + mutable Mutex _mutex; + mutable Cond _cond; + mutable bool _locked; + mutable pthread_t _lockerId; #else mutable pthread_mutex_t _mutex; #endif diff -NEaur Ice-3.2.0/include/Slice/Preprocessor.h Ice-3.2.0-qnx/include/Slice/Preprocessor.h --- Ice-3.2.0/include/Slice/Preprocessor.h 2007-02-05 12:29:55.000000000 +0100 +++ Ice-3.2.0-qnx/include/Slice/Preprocessor.h 2007-04-20 18:48:39.000000000 +0200 @@ -15,6 +15,10 @@ # include #endif +#ifdef __QNX__ +# include // for FILE +#endif + #ifndef SLICE_API # ifdef SLICE_API_EXPORTS # define SLICE_API ICE_DECLSPEC_EXPORT diff -NEaur Ice-3.2.0/Makefile Ice-3.2.0-qnx/Makefile --- Ice-3.2.0/Makefile 2007-01-15 06:28:53.000000000 +0100 +++ Ice-3.2.0-qnx/Makefile 2007-04-21 18:32:28.000000000 +0200 @@ -11,7 +11,8 @@ include $(top_srcdir)/config/Make.rules -SUBDIRS = config src include test demo slice doc +#SUBDIRS = config src include test demo slice doc +SUBDIRS = config src include test slice doc INSTALL_SUBDIRS = $(install_bindir) $(install_libdir) $(install_includedir) $(install_slicedir) $(install_docdir) diff -NEaur Ice-3.2.0/src/Freeze/Makefile Ice-3.2.0-qnx/src/Freeze/Makefile --- Ice-3.2.0/src/Freeze/Makefile 2007-01-08 20:37:12.000000000 +0100 +++ Ice-3.2.0-qnx/src/Freeze/Makefile 2007-04-20 18:48:39.000000000 +0200 @@ -57,7 +57,7 @@ include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I.. $(CPPFLAGS) -DFREEZE_API_EXPORTS $(DB_FLAGS) +CPPFLAGS := -I.. $(CPPFLAGS) -DFREEZE_API_EXPORTS $(DB_FLAGS) $(CPPPLATFORMLIBFLAGS) SLICE2CPPFLAGS := --ice --include-dir Freeze --dll-export FREEZE_API $(SLICE2CPPFLAGS) LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil $(DB_LIBS) diff -NEaur Ice-3.2.0/src/FreezeScript/Makefile Ice-3.2.0-qnx/src/FreezeScript/Makefile --- Ice-3.2.0/src/FreezeScript/Makefile 2007-03-09 00:16:53.000000000 +0100 +++ Ice-3.2.0-qnx/src/FreezeScript/Makefile 2007-04-20 18:48:39.000000000 +0200 @@ -39,7 +39,7 @@ include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I.. $(CPPFLAGS) $(DB_FLAGS) +CPPFLAGS := -I.. $(CPPFLAGS) $(DB_FLAGS) $(CPPPLATFORMLIBFLAGS) BISONFLAGS := --name-prefix "freeze_script_" $(BISONFLAGS) $(TRANSFORMDB): $(TRANSFORM_OBJS) $(COMMON_OBJS) diff -NEaur Ice-3.2.0/src/Glacier2/Makefile Ice-3.2.0-qnx/src/Glacier2/Makefile --- Ice-3.2.0/src/Glacier2/Makefile 2007-01-08 20:37:13.000000000 +0100 +++ Ice-3.2.0-qnx/src/Glacier2/Makefile 2007-04-20 18:48:39.000000000 +0200 @@ -53,7 +53,7 @@ include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I.. $(CPPFLAGS) -DGLACIER2_API_EXPORTS $(OPENSSL_FLAGS) +CPPFLAGS := -I.. $(CPPFLAGS) -DGLACIER2_API_EXPORTS $(OPENSSL_FLAGS) $(CPPPLATFORMLIBFLAGS) SLICE2CPPFLAGS := --include-dir Glacier2 --dll-export GLACIER2_API $(SLICE2CPPFLAGS) LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil diff -NEaur Ice-3.2.0/src/Ice/BasicStream.cpp Ice-3.2.0-qnx/src/Ice/BasicStream.cpp --- Ice-3.2.0/src/Ice/BasicStream.cpp 2007-02-01 17:40:28.000000000 +0100 +++ Ice-3.2.0-qnx/src/Ice/BasicStream.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -25,6 +25,9 @@ #ifdef __BCPLUSPLUS__ # include #endif +#ifdef __QNX__ +# include +#endif using namespace std; using namespace Ice; diff -NEaur Ice-3.2.0/src/Ice/ConnectionFactory.cpp Ice-3.2.0-qnx/src/Ice/ConnectionFactory.cpp --- Ice-3.2.0/src/Ice/ConnectionFactory.cpp 2007-02-07 01:21:33.000000000 +0100 +++ Ice-3.2.0-qnx/src/Ice/ConnectionFactory.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -27,6 +27,9 @@ #ifdef __BCPLUSPLUS__ # include #endif +#ifdef __QNX__ +# include +#endif using namespace std; using namespace Ice; diff -NEaur Ice-3.2.0/src/Ice/GC.cpp Ice-3.2.0-qnx/src/Ice/GC.cpp --- Ice-3.2.0/src/Ice/GC.cpp 2007-02-01 17:40:28.000000000 +0100 +++ Ice-3.2.0-qnx/src/Ice/GC.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -13,6 +13,9 @@ #include #include #include +#ifdef __QNX__ +# include // for abort() +#endif using namespace IceUtil; diff -NEaur Ice-3.2.0/src/Ice/Makefile Ice-3.2.0-qnx/src/Ice/Makefile --- Ice-3.2.0/src/Ice/Makefile 2007-01-16 17:27:54.000000000 +0100 +++ Ice-3.2.0-qnx/src/Ice/Makefile 2007-04-20 18:48:39.000000000 +0200 @@ -142,7 +142,7 @@ include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I.. $(CPPFLAGS) -DICE_API_EXPORTS $(BZIP2_FLAGS) +CPPFLAGS := -I.. $(CPPFLAGS) -DICE_API_EXPORTS $(BZIP2_FLAGS) $(CPPPLATFORMLIBFLAGS) SLICE2CPPFLAGS := --ice --include-dir Ice --dll-export ICE_API $(SLICE2CPPFLAGS) LINKWITH := -lIceUtil $(BZIP2_LIBS) $(ICE_OS_LIBS) diff -NEaur Ice-3.2.0/src/Ice/Network.cpp Ice-3.2.0-qnx/src/Ice/Network.cpp --- Ice-3.2.0/src/Ice/Network.cpp 2007-02-13 11:20:18.000000000 +0100 +++ Ice-3.2.0-qnx/src/Ice/Network.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -13,7 +13,7 @@ #if defined(_WIN32) # include -#elif defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) +#elif defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__QNX__) # include #else # include @@ -1270,7 +1270,7 @@ { result.push_back(inetAddrToString(addrs[i].sin_addr)); } -#elif defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) +#elif defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__QNX__) struct ifaddrs* ifap; if(::getifaddrs(&ifap) == SOCKET_ERROR) { diff -NEaur Ice-3.2.0/src/Ice/ObjectAdapterI.cpp Ice-3.2.0-qnx/src/Ice/ObjectAdapterI.cpp --- Ice-3.2.0/src/Ice/ObjectAdapterI.cpp 2007-02-14 20:20:45.000000000 +0100 +++ Ice-3.2.0-qnx/src/Ice/ObjectAdapterI.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -41,6 +41,9 @@ #ifdef __BCPLUSPLUS__ # include #endif +#ifdef __QNX__ +# include +#endif using namespace std; using namespace Ice; diff -NEaur Ice-3.2.0/src/Ice/TcpTransceiver.h Ice-3.2.0-qnx/src/Ice/TcpTransceiver.h --- Ice-3.2.0/src/Ice/TcpTransceiver.h 2007-01-31 06:20:18.000000000 +0100 +++ Ice-3.2.0-qnx/src/Ice/TcpTransceiver.h 2007-04-20 18:48:39.000000000 +0200 @@ -15,6 +15,9 @@ #include #include #include +#ifdef __QNX__ +# include // for fd_set +#endif namespace IceInternal { diff -NEaur Ice-3.2.0/src/Ice/UdpTransceiver.h Ice-3.2.0-qnx/src/Ice/UdpTransceiver.h --- Ice-3.2.0/src/Ice/UdpTransceiver.h 2007-01-31 06:20:18.000000000 +0100 +++ Ice-3.2.0-qnx/src/Ice/UdpTransceiver.h 2007-04-20 18:48:39.000000000 +0200 @@ -21,6 +21,10 @@ # include // For struct sockaddr_in #endif +#ifdef __QNX__ +# include // for fd_set +#endif + namespace IceInternal { diff -NEaur Ice-3.2.0/src/IceBox/Makefile Ice-3.2.0-qnx/src/IceBox/Makefile --- Ice-3.2.0/src/IceBox/Makefile 2007-01-08 20:37:13.000000000 +0100 +++ Ice-3.2.0-qnx/src/IceBox/Makefile 2007-04-20 18:48:39.000000000 +0200 @@ -39,7 +39,7 @@ include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I.. $(CPPFLAGS) -DICE_BOX_API_EXPORTS +CPPFLAGS := -I.. $(CPPFLAGS) -DICE_BOX_API_EXPORTS $(CPPPLATFORMLIBFLAGS) SLICE2CPPFLAGS := --checksum --ice --dll-export ICE_BOX_API --include-dir IceBox $(SLICE2CPPFLAGS) LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil diff -NEaur Ice-3.2.0/src/IceGrid/Activator.cpp Ice-3.2.0-qnx/src/IceGrid/Activator.cpp --- Ice-3.2.0/src/IceGrid/Activator.cpp 2007-02-08 04:47:27.000000000 +0100 +++ Ice-3.2.0-qnx/src/IceGrid/Activator.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -588,6 +588,83 @@ // } return static_cast(process.pid); +// QNX +#elif __QNX__ + int fds[2]; + if(pipe(fds) != 0) + { + SyscallException ex(__FILE__, __LINE__); + ex.error = getSystemErrno(); + throw ex; + } + + // + // Convert to a vector of arguments expected by spawnv() + // + int argc = static_cast(args.size()); + char** argv = static_cast(malloc((argc + 1) * sizeof(char*))); + int i = 0; + for(StringSeq::const_iterator p = args.begin(); p != args.end(); ++p, ++i) + { + assert(i < argc); + argv[i] = strdup(p->c_str()); + } + assert(i == argc); + argv[argc] = 0; + + int envCount = static_cast(envs.size()); + char** envArray = new char*[envCount+1]; + i = 0; + for(StringSeq::const_iterator q = envs.begin(); q != envs.end(); ++q) + { + envArray[i++] = strdup(q->c_str()); + } + envArray[envCount] = 0; + + #include + std::cout<<"options ["< #endif +#ifdef __QNX__ +# include +#endif + namespace IceGrid { diff -NEaur Ice-3.2.0/src/IcePatch2/Calc.cpp Ice-3.2.0-qnx/src/IcePatch2/Calc.cpp --- Ice-3.2.0/src/IcePatch2/Calc.cpp 2007-02-01 17:40:28.000000000 +0100 +++ Ice-3.2.0-qnx/src/IcePatch2/Calc.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -15,6 +15,10 @@ #ifdef __BCPLUSPLUS__ # include #endif + +#ifdef __QNX__ +# include +#endif using namespace std; using namespace Ice; diff -NEaur Ice-3.2.0/src/IcePatch2/ClientUtil.cpp Ice-3.2.0-qnx/src/IcePatch2/ClientUtil.cpp --- Ice-3.2.0/src/IcePatch2/ClientUtil.cpp 2007-02-14 14:57:26.000000000 +0100 +++ Ice-3.2.0-qnx/src/IcePatch2/ClientUtil.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -18,6 +18,10 @@ # include #endif +#ifdef __QNX__ +# include +#endif + using namespace std; using namespace Ice; using namespace IcePatch2; diff -NEaur Ice-3.2.0/src/IcePatch2/Makefile Ice-3.2.0-qnx/src/IcePatch2/Makefile --- Ice-3.2.0/src/IcePatch2/Makefile 2007-01-08 20:37:13.000000000 +0100 +++ Ice-3.2.0-qnx/src/IcePatch2/Makefile 2007-04-20 18:48:39.000000000 +0200 @@ -46,7 +46,7 @@ include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I. -I.. $(CPPFLAGS) -DICE_PATCH2_API_EXPORTS $(OPENSSL_FLAGS) $(BZIP2_FLAGS) +CPPFLAGS := -I. -I.. $(CPPFLAGS) -DICE_PATCH2_API_EXPORTS $(OPENSSL_FLAGS) $(BZIP2_FLAGS) $(CPPPLATFORMLIBFLAGS) SLICE2CPPFLAGS := --ice --include-dir IcePatch2 --dll-export ICE_PATCH2_API $(SLICE2CPPFLAGS) LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil $(OPENSSL_LIBS) $(BZIP2_LIBS) diff -NEaur Ice-3.2.0/src/IcePatch2/Util.cpp Ice-3.2.0-qnx/src/IcePatch2/Util.cpp --- Ice-3.2.0/src/IcePatch2/Util.cpp 2007-02-02 17:57:46.000000000 +0100 +++ Ice-3.2.0-qnx/src/IcePatch2/Util.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -34,6 +34,11 @@ # include #endif +#ifdef __QNX__ +# include +# include +#endif + const char* IcePatch2::checksumFile = "IcePatch2.sum"; const char* IcePatch2::logFile = "IcePatch2.log"; @@ -614,13 +619,25 @@ return result; #else - +// QNX +#ifdef __QNX__ + assert( path.size()<256 || "path length is limited to 256 chars in QNX hack" ); + char path_str[256]; + strcpy( path_str, path.c_str() ); + struct direct **namelist; + int n = scandir(path_str, &namelist, 0, alphasort); + free(path_str); +#else +// \QNX struct dirent **namelist; #ifdef __sun int n = ice_scandir(path.c_str(), &namelist, 0, ice_alphasort); #else int n = scandir(path.c_str(), &namelist, 0, alphasort); #endif +// QNX +#endif +// \QNX if(n < 0) { throw "cannot read directory `" + path + "':\n" + lastError(); diff -NEaur Ice-3.2.0/src/IceSSL/Makefile Ice-3.2.0-qnx/src/IceSSL/Makefile --- Ice-3.2.0/src/IceSSL/Makefile 2007-01-08 20:37:13.000000000 +0100 +++ Ice-3.2.0-qnx/src/IceSSL/Makefile 2007-04-20 18:48:39.000000000 +0200 @@ -32,7 +32,7 @@ include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I.. $(CPPFLAGS) -DICE_SSL_API_EXPORTS $(OPENSSL_FLAGS) +CPPFLAGS := -I.. $(CPPFLAGS) -DICE_SSL_API_EXPORTS $(OPENSSL_FLAGS) $(CPPPLATFORMLIBFLAGS) LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil $(OPENSSL_LIBS) $(CXXLIBS) diff -NEaur Ice-3.2.0/src/IceSSL/PluginI.cpp Ice-3.2.0-qnx/src/IceSSL/PluginI.cpp --- Ice-3.2.0/src/IceSSL/PluginI.cpp 2007-02-01 17:40:28.000000000 +0100 +++ Ice-3.2.0-qnx/src/IceSSL/PluginI.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -81,7 +81,7 @@ // On some platforms, pthread_t is a pointer to a per-thread structure. // return reinterpret_cast(pthread_self()); -#elif (defined(__linux) || defined(__sun) || defined(__hpux)) || defined(_AIX) +#elif (defined(__linux) || defined(__sun) || defined(__hpux)) || defined(_AIX) || defined(__QNX__) // // On Linux, Solaris, HP-UX and AIX, pthread_t is an integer. // diff -NEaur Ice-3.2.0/src/IceStorm/Makefile Ice-3.2.0-qnx/src/IceStorm/Makefile --- Ice-3.2.0/src/IceStorm/Makefile 2007-03-09 00:16:53.000000000 +0100 +++ Ice-3.2.0-qnx/src/IceStorm/Makefile 2007-04-20 18:48:39.000000000 +0200 @@ -59,7 +59,7 @@ include $(top_srcdir)/config/Make.rules -CPPFLAGS := $(CPPFLAGS) -I.. -DICE_STORM_API_EXPORTS $(READLINE_FLAGS) +CPPFLAGS := $(CPPFLAGS) -I.. -DICE_STORM_API_EXPORTS $(READLINE_FLAGS) $(CPPPLATFORMLIBFLAGS) ICECPPFLAGS := $(ICECPPFLAGS) -I.. SLICE2CPPFLAGS := --checksum --ice --dll-export ICE_STORM_API --include-dir IceStorm $(SLICE2CPPFLAGS) LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil diff -NEaur Ice-3.2.0/src/IceStorm/Subscriber.cpp Ice-3.2.0-qnx/src/IceStorm/Subscriber.cpp --- Ice-3.2.0/src/IceStorm/Subscriber.cpp 2007-02-20 14:21:29.000000000 +0100 +++ Ice-3.2.0-qnx/src/IceStorm/Subscriber.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -23,6 +23,10 @@ #include #endif +#ifdef __QNX__ +# include +#endif + using namespace std; using namespace IceStorm; diff -NEaur Ice-3.2.0/src/IceUtil/ArgVector.cpp Ice-3.2.0-qnx/src/IceUtil/ArgVector.cpp --- Ice-3.2.0/src/IceUtil/ArgVector.cpp 2007-02-08 15:52:07.000000000 +0100 +++ Ice-3.2.0-qnx/src/IceUtil/ArgVector.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -10,6 +10,10 @@ #include #include +#ifdef __QNX__ +# include // for strlen(), strcpy() +#endif + IceUtil::ArgVector::ArgVector(int argc, char *argv[]) { assert(argc >= 0); diff -NEaur Ice-3.2.0/src/IceUtil/Base64.cpp Ice-3.2.0-qnx/src/IceUtil/Base64.cpp --- Ice-3.2.0/src/IceUtil/Base64.cpp 2007-01-08 20:37:13.000000000 +0100 +++ Ice-3.2.0-qnx/src/IceUtil/Base64.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -13,6 +13,10 @@ # include #endif +#ifdef __QNX__ +# include +#endif + using namespace std; string diff -NEaur Ice-3.2.0/src/IceUtil/Makefile Ice-3.2.0-qnx/src/IceUtil/Makefile --- Ice-3.2.0/src/IceUtil/Makefile 2007-02-08 04:47:27.000000000 +0100 +++ Ice-3.2.0-qnx/src/IceUtil/Makefile 2007-04-20 18:48:39.000000000 +0200 @@ -43,7 +43,7 @@ include $(top_srcdir)/config/Make.rules -CPPFLAGS := $(CPPFLAGS) -DICE_UTIL_API_EXPORTS -I.. +CPPFLAGS := $(CPPFLAGS) -DICE_UTIL_API_EXPORTS -I.. $(CPPPLATFORMLIBFLAGS) LINKWITH := $(STLPORT_LIBS) $(ICEUTIL_OS_LIBS) diff -NEaur Ice-3.2.0/src/IceUtil/RecMutex.cpp Ice-3.2.0-qnx/src/IceUtil/RecMutex.cpp --- Ice-3.2.0/src/IceUtil/RecMutex.cpp 2007-02-01 17:40:28.000000000 +0100 +++ Ice-3.2.0-qnx/src/IceUtil/RecMutex.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -188,7 +188,126 @@ } # endif +// QNX +#elif defined(__QNX__) +IceUtil::RecMutex::RecMutex() : + _locked(false), + _count(0) +{ +} + +IceUtil::RecMutex::~RecMutex() +{ +} + +void +IceUtil::RecMutex::lock() const +{ + // obtain lock on internal data, i.e. count, lockerId + Mutex::Lock sync(_mutex); + + pthread_t id = pthread_self(); + + // lock is locked AND the new locker is from the same thread which currently holds the lock. + // we increment the counter and return + if(_locked && pthread_equal(_lockerId, id)) + { + ++_count; + return; + } + + // lock is locked AND the new locker is from a diff thread. + // we block until the current lock holder fully releases (counter becomes zero) + while(_locked) + { + _cond.wait(sync); + } + + // two possible ways we got here: + // a) same thread and unlocked + // b) diff thread, waited and got notified + // we lock the lock and become the lock holder (we are first so counter is 1) + _locked = true; + _lockerId = id; + _count = 1; +} + +bool +IceUtil::RecMutex::tryLock() const +{ + Mutex::Lock sync(_mutex); + + pthread_t id = pthread_self(); + + // lock is locked AND the new locker is from the same thread which currently holds the lock. + // we increment the counter and return false (because the lock was already locked) + if(_locked && pthread_equal(_lockerId, id)) + { + ++_count; + // i think this is the right response + return true; + } + + // lock is locked AND the new locker is from a diff thread. + if(_locked) + { + // i think this is the right response + return false; +// throw ThreadLockedException(__FILE__, __LINE__); + } + + // same thread and unlocked + // we lock the lock and become the lock holder (we are first so counter is 1) + _locked = true; + _lockerId = id; + _count = 1; + + return true; +} + +void +IceUtil::RecMutex::unlock() const +{ + Mutex::Lock sync(_mutex); + + if(--_count == 0) + { + _locked = false; + _cond.signal(); + } +} + +void +IceUtil::RecMutex::unlock(LockState& state) const +{ + _mutex.lock(); + + assert(_locked); + _locked = false; + + _cond.signal(); + + state.mutex = &_mutex._mutex; + state.count = _count; +} + +void +IceUtil::RecMutex::lock(LockState& state) const +{ + while(_locked) + { + _cond.waitImpl(_mutex); + } + + _lockerId = pthread_self(); + _locked = true; + + _count = state.count; + + _mutex.unlock(); + } +// \QNX #else IceUtil::RecMutex::RecMutex() : diff -NEaur Ice-3.2.0/src/IceXML/Makefile Ice-3.2.0-qnx/src/IceXML/Makefile --- Ice-3.2.0/src/IceXML/Makefile 2007-01-08 20:37:13.000000000 +0100 +++ Ice-3.2.0-qnx/src/IceXML/Makefile 2007-04-20 18:48:39.000000000 +0200 @@ -21,7 +21,7 @@ include $(top_srcdir)/config/Make.rules -CPPFLAGS := $(CPPFLAGS) -DICE_XML_API_EXPORTS $(EXPAT_FLAGS) +CPPFLAGS := $(CPPFLAGS) -DICE_XML_API_EXPORTS $(EXPAT_FLAGS) $(CPPPLATFORMLIBFLAGS) LINKWITH := -lIceUtil $(EXPAT_LIBS) diff -NEaur Ice-3.2.0/src/Slice/Makefile Ice-3.2.0-qnx/src/Slice/Makefile --- Ice-3.2.0/src/Slice/Makefile 2007-03-09 00:16:53.000000000 +0100 +++ Ice-3.2.0-qnx/src/Slice/Makefile 2007-04-20 18:48:39.000000000 +0200 @@ -32,7 +32,7 @@ include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I.. $(CPPFLAGS) -DSLICE_API_EXPORTS +CPPFLAGS := -I.. $(CPPFLAGS) -DSLICE_API_EXPORTS $(CPPPLATFORMLIBFLAGS) LINKWITH := -lIceUtil BISONFLAGS := --name-prefix "slice_" $(BISONFLAGS) diff -NEaur Ice-3.2.0/src/Slice/Parser.cpp Ice-3.2.0-qnx/src/Slice/Parser.cpp --- Ice-3.2.0/src/Slice/Parser.cpp 2007-02-01 17:40:28.000000000 +0100 +++ Ice-3.2.0-qnx/src/Slice/Parser.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -14,6 +14,10 @@ # include #endif +#ifdef __QNX__ +# include +#endif + using namespace std; using namespace Slice; diff -NEaur Ice-3.2.0/src/Slice/PythonUtil.cpp Ice-3.2.0-qnx/src/Slice/PythonUtil.cpp --- Ice-3.2.0/src/Slice/PythonUtil.cpp 2007-02-01 17:40:28.000000000 +0100 +++ Ice-3.2.0-qnx/src/Slice/PythonUtil.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -14,6 +14,10 @@ # include #endif +#ifdef __QNX__ +# include +#endif + using namespace std; using namespace Slice; using namespace IceUtil; diff -NEaur Ice-3.2.0/src/Slice/RubyUtil.cpp Ice-3.2.0-qnx/src/Slice/RubyUtil.cpp --- Ice-3.2.0/src/Slice/RubyUtil.cpp 2007-02-23 17:44:10.000000000 +0100 +++ Ice-3.2.0-qnx/src/Slice/RubyUtil.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -15,6 +15,10 @@ #include #endif +#ifdef __QNX__ +# include +#endif + using namespace std; using namespace Slice; using namespace IceUtil; diff -NEaur Ice-3.2.0/src/slice2docbook/Gen.h Ice-3.2.0-qnx/src/slice2docbook/Gen.h --- Ice-3.2.0/src/slice2docbook/Gen.h 2007-01-08 20:37:13.000000000 +0100 +++ Ice-3.2.0-qnx/src/slice2docbook/Gen.h 2007-04-20 18:48:39.000000000 +0200 @@ -14,6 +14,10 @@ #include #include +#ifdef __QNX__ +# include +#endif + namespace Slice { diff -NEaur Ice-3.2.0/src/slice2freezej/Main.cpp Ice-3.2.0-qnx/src/slice2freezej/Main.cpp --- Ice-3.2.0/src/slice2freezej/Main.cpp 2007-02-05 12:28:28.000000000 +0100 +++ Ice-3.2.0-qnx/src/slice2freezej/Main.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -15,6 +15,10 @@ # include #endif +#ifdef __QNX__ +# include +#endif + using namespace std; using namespace Slice; using namespace IceUtil; diff -NEaur Ice-3.2.0/src/slice2html/Gen.cpp Ice-3.2.0-qnx/src/slice2html/Gen.cpp --- Ice-3.2.0/src/slice2html/Gen.cpp 2007-03-07 04:21:46.000000000 +0100 +++ Ice-3.2.0-qnx/src/slice2html/Gen.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -24,6 +24,10 @@ # include #endif +#ifdef __QNX__ +# include +#endif + using namespace std; using namespace Slice; using namespace IceUtil; diff -NEaur Ice-3.2.0/src/slice2java/Main.cpp Ice-3.2.0-qnx/src/slice2java/Main.cpp --- Ice-3.2.0/src/slice2java/Main.cpp 2007-02-05 12:28:28.000000000 +0100 +++ Ice-3.2.0-qnx/src/slice2java/Main.cpp 2007-04-20 18:48:39.000000000 +0200 @@ -15,6 +15,10 @@ # include #endif +#ifdef __QNX__ +# include +#endif + using namespace std; using namespace Slice; diff -NEaur Ice-3.2.0/test/Ice/custom/MyByteSeq.cpp Ice-3.2.0-qnx/test/Ice/custom/MyByteSeq.cpp --- Ice-3.2.0/test/Ice/custom/MyByteSeq.cpp 2007-03-03 04:21:43.000000000 +0100 +++ Ice-3.2.0-qnx/test/Ice/custom/MyByteSeq.cpp 2007-04-20 20:07:31.000000000 +0200 @@ -9,6 +9,10 @@ #include +#ifdef __QNX__ +# include +#endif + MyByteSeq::MyByteSeq() : _size(0), _data(0) diff -NEaur Ice-3.2.0/test/Ice/faultTolerance/TestI.cpp Ice-3.2.0-qnx/test/Ice/faultTolerance/TestI.cpp --- Ice-3.2.0/test/Ice/faultTolerance/TestI.cpp 2007-01-08 20:37:14.000000000 +0100 +++ Ice-3.2.0-qnx/test/Ice/faultTolerance/TestI.cpp 2007-04-21 18:31:40.000000000 +0200 @@ -10,6 +10,10 @@ #include #include +#ifdef __QNX__ +# include +#endif + TestI::TestI(const Ice::ObjectAdapterPtr& adapter) : _adapter(adapter) { diff -NEaur Ice-3.2.0/test/Ice/operations/TestAMDI.cpp Ice-3.2.0-qnx/test/Ice/operations/TestAMDI.cpp --- Ice-3.2.0/test/Ice/operations/TestAMDI.cpp 2007-02-01 17:40:29.000000000 +0100 +++ Ice-3.2.0-qnx/test/Ice/operations/TestAMDI.cpp 2007-04-20 19:50:01.000000000 +0200 @@ -15,6 +15,10 @@ # include #endif +#ifdef __QNX__ +# include +#endif + class Thread_opVoid : public IceUtil::Thread { public: diff -NEaur Ice-3.2.0/test/Ice/operations/TestI.cpp Ice-3.2.0-qnx/test/Ice/operations/TestI.cpp --- Ice-3.2.0/test/Ice/operations/TestI.cpp 2007-02-01 17:40:29.000000000 +0100 +++ Ice-3.2.0-qnx/test/Ice/operations/TestI.cpp 2007-04-20 19:49:09.000000000 +0200 @@ -16,6 +16,10 @@ # include #endif +#ifdef __QNX__ +# include +#endif + MyDerivedClassI::MyDerivedClassI(const Ice::ObjectAdapterPtr& adapter, const Ice::Identity& identity) : _adapter(adapter), _identity(identity) diff -NEaur Ice-3.2.0/test/include/TestCommon.h Ice-3.2.0-qnx/test/include/TestCommon.h --- Ice-3.2.0/test/include/TestCommon.h 2007-01-08 20:37:14.000000000 +0100 +++ Ice-3.2.0-qnx/test/include/TestCommon.h 2007-04-20 19:39:58.000000000 +0200 @@ -17,6 +17,10 @@ #include #endif +#ifdef __QNX__ +# include +#endif + void inline testFailed(const char* expr, const char* file, unsigned int line) {