From 2fd0625d21f1fa8e6a3adfc89ce9f381a4d33990 Mon Sep 17 00:00:00 2001 From: Juergen Gehring Date: Thu, 25 Jan 2018 01:01:22 -0800 Subject: capicxx-core-runtime 3.1.12.4 --- CHANGES | 5 +++++ CMakeLists.txt | 12 ++++++++---- include/CommonAPI/Event.hpp | 5 ++++- include/CommonAPI/Variant.hpp | 4 ++-- src/CommonAPI/Runtime.cpp | 2 ++ 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 2995b02..f115e84 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes ======= + +v3.1.12.4 +- Fix calling of registered subscription status handlers for + selective broadcasts + v3.1.12.3 - Added copy constructor for CommonAPI CallInfo diff --git a/CMakeLists.txt b/CMakeLists.txt index 9aeb97a..7897345 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,10 +42,14 @@ SET(RPM_PACKAGE_VERSION "r0" CACHE STRING "rpm packet version") # used in e.g. c SET(MAX_LOG_LEVEL "DEBUG" CACHE STRING "maximum log level") message(STATUS "MAX_LOG_LEVEL is set to value: ${MAX_LOG_LEVEL}") +# Set a default build type if none was specified +set(default_build_type "RelWithDebInfo") if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Debug" CACHE STRING - "Choose the type of build, options are: Debug Release." FORCE) -endif(NOT CMAKE_BUILD_TYPE) + message(STATUS "Setting build type to '${default_build_type}' as none was specified.") + set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() set(CMAKE_BUILD_TYPE_FOR_SPEC_IN "") string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_FOR_SPEC_IN) @@ -98,7 +102,7 @@ IF(MSVC) add_definitions(-DCOMMONAPI_INTERNAL_COMPILATION -DCOMMONAPI_DLL_COMPILATION) add_compile_options(/EHsc /wd4996) ELSE () - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector -fasynchronous-unwind-tables -fno-omit-frame-pointer -Werror -DCOMMONAPI_INTERNAL_COMPILATION") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector -fasynchronous-unwind-tables -fno-omit-frame-pointer -Werror -DCOMMONAPI_INTERNAL_COMPILATION") ENDIF(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOMMONAPI_LOGLEVEL=COMMONAPI_LOGLEVEL_${MAX_LOG_LEVEL}") diff --git a/include/CommonAPI/Event.hpp b/include/CommonAPI/Event.hpp index 67cc6dc..ab656f8 100644 --- a/include/CommonAPI/Event.hpp +++ b/include/CommonAPI/Event.hpp @@ -115,8 +115,11 @@ typename Event::Subscription Event::subscribe(List pendingSubscriptions_[subscription] = std::move(listeners); subscriptionMutex_.unlock(); - if (isFirstListener) + if (isFirstListener) { + if (!pendingUnsubscriptions_.empty()) + onLastListenerRemoved(listener); onFirstListenerAdded(listener); + } onListenerAdded(listener, subscription); return subscription; diff --git a/include/CommonAPI/Variant.hpp b/include/CommonAPI/Variant.hpp index 8ae9e6c..db1cf7b 100644 --- a/include/CommonAPI/Variant.hpp +++ b/include/CommonAPI/Variant.hpp @@ -710,11 +710,11 @@ const Type_ & Variant::get() const { if (itsType == valueType_) { return *(reinterpret_cast(&valueStorage_)); } else { -#ifdef __EXCEPTIONS +#if defined(__EXCEPTIONS) || defined(_CPPUNWIND) std::bad_cast toThrow; throw toThrow; #else - printf("SerializableVariant.hpp:%i %s: Incorrect access to variant; attempting to get type not currently contained", __LINE__, __FUNCTION__); + printf("Variant.hpp:%i %s: Incorrect access to variant; attempting to get type not currently contained", __LINE__, __FUNCTION__); abort(); #endif } diff --git a/src/CommonAPI/Runtime.cpp b/src/CommonAPI/Runtime.cpp index daf6a66..9bae2e2 100644 --- a/src/CommonAPI/Runtime.cpp +++ b/src/CommonAPI/Runtime.cpp @@ -55,7 +55,9 @@ Runtime::setProperty(const std::string &_name, const std::string &_value) { } std::shared_ptr Runtime::get() { +#ifndef _WIN32 std::lock_guard itsLock(getMutex__); +#endif if(!theRuntimePtr__) { theRuntimePtr__ = new std::shared_ptr(); } -- cgit v1.2.1