diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/config/Make.rules.Darwin | 27 | ||||
-rw-r--r-- | cpp/config/Make.rules.Linux | 16 | ||||
-rw-r--r-- | cpp/include/Ice/AsyncResult.h | 10 | ||||
-rw-r--r-- | cpp/src/Ice/CommunicatorI.cpp | 7 | ||||
-rw-r--r-- | cpp/src/Ice/CommunicatorI.h | 3 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 8 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionI.h | 3 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 12 |
8 files changed, 42 insertions, 44 deletions
diff --git a/cpp/config/Make.rules.Darwin b/cpp/config/Make.rules.Darwin index f8445705f41..c0205611727 100644 --- a/cpp/config/Make.rules.Darwin +++ b/cpp/config/Make.rules.Darwin @@ -11,7 +11,7 @@ # This file is included by Make.rules when uname is Darwin. # -OSX_TARGET_MIN_SDK_VERSION = 10.9 +OSX_TARGET_MIN_SDK_VERSION = 10.9 CXX = xcrun clang++ @@ -23,20 +23,21 @@ ifeq ($(OPTIMIZE),yes) # By default we build binaries with both architectures when optimization is enabled. # ifeq ($(CXXARCHFLAGS),) - CXXARCHFLAGS := -arch i386 -arch x86_64 + CXXARCHFLAGS := -arch i386 -arch x86_64 endif CXXFLAGS := $(CXXARCHFLAGS) -O2 -DNDEBUG $(CXXFLAGS) else CXXFLAGS := $(CXXARCHFLAGS) -g $(CXXFLAGS) endif -ifeq ($(CPP11), yes) +# +# On OS X, always build with C++11 support enabled unless we +# explicitly set it to no (possibly to test binary compatibility). +# +ifneq ($(CPP11), no) CPPFLAGS += --std=c++11 endif -mklibfilename = $(if $(2),lib$(1)$(cpp11libsuffix).$(2).dylib,lib$(1)$(cpp11libsuffix).dylib) -mksoname = $(if $(2),lib$(1)$(cpp11libsuffix).$(2).dylib,lib$(1).dylib) - # # C++ run-time libraries, necessary for linking some shared libraries. # @@ -55,16 +56,8 @@ ifeq ($(CXX),g++) LDPLATFORMFLAGS += -rdynamic endif -ifeq ($(STATICLIBS),yes) - mklibname = lib$(1).a -else - mklibname = lib$(1).dylib -endif -mklib = libtool -static -o $(1) $(2) - -curdir = $(shell pwd) - -mkshlib = $(CXX) -dynamiclib $(LDFLAGS) -o $(1) -install_name @rpath/$(2) $(3) $(4) +mklib = libtool -static -o $(1) $(2) +mkshlib = $(CXX) -dynamiclib $(LDFLAGS) -o $(1) -install_name @rpath/$(2) $(3) $(4) BASELIBS = -lIceUtil LIBS = -lIce $(BASELIBS) @@ -93,5 +86,3 @@ ifeq ($(MCPP_HOME),) MCPP_HOME = $(THIRDPARTY_HOME) endif endif - - diff --git a/cpp/config/Make.rules.Linux b/cpp/config/Make.rules.Linux index 2701255338a..ccee5486940 100644 --- a/cpp/config/Make.rules.Linux +++ b/cpp/config/Make.rules.Linux @@ -13,11 +13,11 @@ USE_SPARC_ASM = irrelevant MACHINE = $(shell uname -m) -SUSE_i586 = $(shell grep i586 /etc/SuSE-release 2>/dev/null) +SUSE_i586 = $(shell grep i586 /etc/SuSE-release 2>/dev/null) ifneq ($(shell grep 'release 4' /etc/redhat-release 2>/dev/null),) NPTL_LIB = -L/usr/$(libsubdir)/nptl - NPTL_FLAGS = -I/usr/include/nptl + NPTL_FLAGS = -I/usr/include/nptl endif # @@ -40,7 +40,7 @@ ifeq ($(CXX),g++) ifeq ($(CPP11), yes) CPPFLAGS += -std=c++0x endif - + ifeq ($(MACHINE),sparc64) # # We are an ultra, at least, and so have the atomic instructions @@ -100,7 +100,7 @@ ifeq ($(CXX),g++) mklib = ar cr $(1) $(2) - rpathlink = -Wl,-rpath-link,$(1) + rpathlink = -Wl,-rpath-link,$(1) ifneq ($(embedded_runpath_prefix),) LDPLATFORMFLAGS = -Wl,--enable-new-dtags -Wl,-rpath,$(runpath_libdir) @@ -140,7 +140,7 @@ ifeq ($(CXX),icpc) mklib = ar cr $(1) $(2) - rpathlink = -Wl,-rpath-link,$(1) + rpathlink = -Wl,-rpath-link,$(1) endif @@ -150,10 +150,10 @@ ifneq ($(NPTL_LIB),) BASELIBS := $(NPTL_LIB) $(BASELIBS) endif -ICESSL_LIBS = $(OPENSSL_RPATH_LINK) -lIceSSL +ICESSL_LIBS = $(OPENSSL_RPATH_LINK) -lIceSSL LIBS = $(BZIP2_RPATH_LINK) -lIce $(BASELIBS) -ICEUTIL_OS_LIBS = -lrt $(OPENSSL_RPATH_LINK) -lcrypto -ICE_OS_LIBS = -ldl +ICEUTIL_OS_LIBS = -lrt $(OPENSSL_RPATH_LINK) -lcrypto +ICE_OS_LIBS = -ldl PLATFORM_HAS_READLINE = yes diff --git a/cpp/include/Ice/AsyncResult.h b/cpp/include/Ice/AsyncResult.h index c94d4f01a19..2a415b060d1 100644 --- a/cpp/include/Ice/AsyncResult.h +++ b/cpp/include/Ice/AsyncResult.h @@ -312,6 +312,16 @@ public: } }; +#else + +template<class S> class Function +{ +public: + Function() + { + } +}; + #endif } diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp index a7c2aee35d2..9a48b60d55b 100644 --- a/cpp/src/Ice/CommunicatorI.cpp +++ b/cpp/src/Ice/CommunicatorI.cpp @@ -221,11 +221,11 @@ Ice::CommunicatorI::begin_flushBatchRequests(const Callback_Communicator_flushBa return __begin_flushBatchRequests(cb, cookie); } -#ifdef ICE_CPP11 AsyncResultPtr Ice::CommunicatorI::begin_flushBatchRequests(const IceInternal::Function<void (const Exception&)>& exception, const IceInternal::Function<void (bool)>& sent) { +#ifdef ICE_CPP11 class Cpp11CB : public IceInternal::Cpp11FnCallbackNC { @@ -256,8 +256,11 @@ Ice::CommunicatorI::begin_flushBatchRequests(const IceInternal::Function<void (c }; return __begin_flushBatchRequests(new Cpp11CB(exception, sent), 0); -} +#else + assert(false); // Ice not built with C++11 support. + return 0; #endif +} namespace { diff --git a/cpp/src/Ice/CommunicatorI.h b/cpp/src/Ice/CommunicatorI.h index 91fdb0ccfc3..58c9da5cd7b 100644 --- a/cpp/src/Ice/CommunicatorI.h +++ b/cpp/src/Ice/CommunicatorI.h @@ -65,11 +65,10 @@ public: virtual AsyncResultPtr begin_flushBatchRequests(const CallbackPtr&, const LocalObjectPtr& = 0); virtual AsyncResultPtr begin_flushBatchRequests(const Callback_Communicator_flushBatchRequestsPtr&, const LocalObjectPtr& = 0); -#ifdef ICE_CPP11 + virtual AsyncResultPtr begin_flushBatchRequests( const IceInternal::Function<void (const Exception&)>&, const IceInternal::Function<void (bool)>& = IceInternal::Function<void (bool)>()); -#endif virtual void end_flushBatchRequests(const AsyncResultPtr&); diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index eb2a03cfc34..8da88c6842e 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -993,12 +993,11 @@ Ice::ConnectionI::begin_flushBatchRequests(const Callback_Connection_flushBatchR return __begin_flushBatchRequests(cb, cookie); } -#ifdef ICE_CPP11 AsyncResultPtr Ice::ConnectionI::begin_flushBatchRequests(const IceInternal::Function<void (const Exception&)>& exception, const IceInternal::Function<void (bool)>& sent) { - +#ifdef ICE_CPP11 class Cpp11CB : public IceInternal::Cpp11FnCallbackNC { public: @@ -1028,8 +1027,11 @@ Ice::ConnectionI::begin_flushBatchRequests(const IceInternal::Function<void (con }; return __begin_flushBatchRequests(new Cpp11CB(exception, sent), 0); +#else + assert(false); // Ice not built with C++11 support. + return 0; +#endif } -#endif AsyncResultPtr Ice::ConnectionI::__begin_flushBatchRequests(const CallbackBasePtr& cb, const LocalObjectPtr& cookie) diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h index 6ed4618eed7..0542741e49b 100644 --- a/cpp/src/Ice/ConnectionI.h +++ b/cpp/src/Ice/ConnectionI.h @@ -171,11 +171,10 @@ public: virtual AsyncResultPtr begin_flushBatchRequests(const CallbackPtr&, const LocalObjectPtr& = 0); virtual AsyncResultPtr begin_flushBatchRequests(const Callback_Connection_flushBatchRequestsPtr&, const LocalObjectPtr& = 0); -#ifdef ICE_CPP11 + virtual AsyncResultPtr begin_flushBatchRequests( const ::IceInternal::Function<void (const ::Ice::Exception&)>&, const ::IceInternal::Function<void (bool)>& = ::IceInternal::Function<void (bool)>()); -#endif virtual void end_flushBatchRequests(const AsyncResultPtr&); diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 57f3337c06f..7b195708399 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -3664,17 +3664,11 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p) } } - H.zeroIndent(); - H << nl << "#ifdef ICE_CPP11"; - H.restoreIndent(); - + H << nl << "// Only supported with C++ 11 support enabled"; H << nl << "virtual ::Ice::AsyncResultPtr begin_" << name << spar << paramsDeclAMI << "const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception" - << "const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()" << epar << " = 0;"; - - H.zeroIndent(); - H << nl << "#endif"; - H.restoreIndent(); + << "const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()" + << epar << " = 0;"; H << sp << nl << "virtual ::Ice::AsyncResultPtr begin_" << name << spar << paramsDeclAMI << epar << " = 0;"; |