diff -Nru platform-1.0.0/CMakeLists.txt platform-1.0.7/CMakeLists.txt --- platform-1.0.0/CMakeLists.txt 2015-04-05 22:04:29.000000000 +0000 +++ platform-1.0.7/CMakeLists.txt 2015-05-08 20:16:31.000000000 +0000 @@ -1,6 +1,6 @@ project(platform) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.9) enable_language(CXX) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}) @@ -13,15 +13,21 @@ set(platform_DESCRIPTION "Platform support library") set(platform_VERSION_MAJOR 1) set(platform_VERSION_MINOR 0) -set(platform_VERSION_PATCH 0) +set(platform_VERSION_PATCH 7) + +set(CMAKE_POSITION_INDEPENDENT_CODE on) if(WIN32) set(PLAT_SOURCES src/windows/dlfcn-win32.cpp src/windows/os-threads.cpp) -else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif() +set(platform_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/platform") +IF(WIN32) + LIST(APPEND platform_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/platform/windows") +ENDIF(WIN32) +set(platform_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + if(NOT ${CORE_SYSTEM_NAME} STREQUAL "") if(${CORE_SYSTEM_NAME} STREQUAL "darwin" OR ${CORE_SYSTEM_NAME} STREQUAL "ios") list(APPEND platform_LIBRARIES "-framework CoreVideo -framework IOKit") diff -Nru platform-1.0.0/debian/changelog platform-1.0.7/debian/changelog --- platform-1.0.0/debian/changelog 2015-04-05 22:04:29.000000000 +0000 +++ platform-1.0.7/debian/changelog 2015-05-08 20:16:31.000000000 +0000 @@ -1,3 +1,41 @@ +platform (1.0.7-1~trusty) trusty; urgency=medium + + * fixed: include on OS X + + -- Pulse-Eight Packaging Fri, 08 May 2015 22:15:23 +0100 + +platform (1.0.6-1~trusty) trusty; urgency=medium + + * fixed: add include path and link the threads lib + * (re-)added: public Reset() function in CEvent + * sync UseMultiArch.cmake + + -- Pulse-Eight Packaging Thu, 07 May 2015 21:20:00 +0100 + +platform (1.0.5-1~trusty) trusty; urgency=medium + + * fixed: missing #include in socket.h + + -- Pulse-Eight Packaging Mon, 04 May 2015 01:29:00 +0100 + +platform (1.0.4-1~trusty) trusty; urgency=medium + + * proper platform.pc.in fix + + -- Pulse-Eight Packaging Sun, 03 May 2015 21:56:00 +0100 + +platform (1.0.3-1~trusty) trusty; urgency=medium + + * platform.pc.in fix + + -- Pulse-Eight Packaging Fri, 01 May 2015 14:38:00 +0100 + +platform (1.0.2-1~trusty) trusty; urgency=medium + + * Build fixes + + -- Pulse-Eight Packaging Fri, 01 May 2015 01:38:00 +0100 + platform (1.0.0-1~trusty) trusty; urgency=medium * Initial release diff -Nru platform-1.0.0/debian/changelog.in platform-1.0.7/debian/changelog.in --- platform-1.0.0/debian/changelog.in 2015-04-05 22:04:29.000000000 +0000 +++ platform-1.0.7/debian/changelog.in 2015-05-08 20:16:31.000000000 +0000 @@ -1,5 +1,44 @@ -platform (1.0.0-1~#DIST#) #DIST#; urgency=low +platform (1.0.7-1~#DIST#) #DIST#; urgency=medium + + * fixed: include on OS X + + -- Pulse-Eight Packaging Fri, 08 May 2015 22:15:23 +0100 + +platform (1.0.6-1~#DIST#) #DIST#; urgency=medium + + * fixed: add include path and link the threads lib + * (re-)added: public Reset() function in CEvent + * sync UseMultiArch.cmake + + -- Pulse-Eight Packaging Thu, 07 May 2015 21:20:00 +0100 + +platform (1.0.5-1~#DIST#) #DIST#; urgency=medium + + * fixed: missing #include in socket.h + + -- Pulse-Eight Packaging Mon, 04 May 2015 01:29:00 +0100 + +platform (1.0.4-1~#DIST#) #DIST#; urgency=medium + + * proper platform.pc.in fix + + -- Pulse-Eight Packaging Sun, 03 May 2015 21:56:00 +0100 + +platform (1.0.3-1~#DIST#) #DIST#; urgency=medium + + * platform.pc.in fix + + -- Pulse-Eight Packaging Fri, 01 May 2015 14:38:00 +0100 + +platform (1.0.2-1~#DIST#) #DIST#; urgency=medium + + * Build fixes + + -- Pulse-Eight Packaging Fri, 01 May 2015 01:38:00 +0100 + +platform (1.0.0-1~#DIST#) #DIST#; urgency=medium * Initial release - -- Nobody Sun, 08 May 2015 11:03:53 +0100 + -- Pulse-Eight Packaging Thu, 12 Mar 2015 13:35:07 +0100 + diff -Nru platform-1.0.0/debian/control platform-1.0.7/debian/control --- platform-1.0.0/debian/control 2015-04-05 22:04:29.000000000 +0000 +++ platform-1.0.7/debian/control 2015-05-08 20:16:31.000000000 +0000 @@ -1,7 +1,7 @@ Source: platform Priority: extra Maintainer: Lars Op den Kamp -Build-Depends: debhelper (>= 8.0.0), cmake +Build-Depends: debhelper (>= 8.0.0), cmake (>= 2.8.9) Standards-Version: 3.9.2 Section: libs diff -Nru platform-1.0.0/platform.pc.in platform-1.0.7/platform.pc.in --- platform-1.0.0/platform.pc.in 2015-04-05 22:04:29.000000000 +0000 +++ platform-1.0.7/platform.pc.in 2015-05-08 20:16:31.000000000 +0000 @@ -1,12 +1,10 @@ prefix=@prefix@ libdir=@libdir@ includedir=@includedir@ -CXX=@CMAKE_CXX_COMPILER@ @CXX_STD0X_FLAGS@ -CC=@CMAKE_C_COMPILER@ @C_STD99_FLAGS@ DEPENDENCIES=@platform_LIBRARIES@ Name: @name@ Description: @description@ @major@.@minor@ Version: @major@.@minor@ -Libs: @target@ @libs@ -Cflags: @CMAKE_CXX_FLAGS@ +Libs: -L${libdir} -lplatform +Cflags: -I${includedir} diff -Nru platform-1.0.0/src/posix/os-socket.h platform-1.0.7/src/posix/os-socket.h --- platform-1.0.0/src/posix/os-socket.h 2015-04-05 22:04:29.000000000 +0000 +++ platform-1.0.7/src/posix/os-socket.h 2015-05-08 20:16:31.000000000 +0000 @@ -286,7 +286,9 @@ inline bool TcpConnectSocket(tcp_socket_t socket, struct addrinfo* addr, int *iError, uint64_t iTimeout = 0) { *iError = 0; + SocketSetBlocking(socket, false); int iConnectResult = connect(socket, addr->ai_addr, addr->ai_addrlen); + SocketSetBlocking(socket, true); if (iConnectResult == -1) { if (errno == EINPROGRESS) diff -Nru platform-1.0.0/src/posix/os-types.h platform-1.0.7/src/posix/os-types.h --- platform-1.0.0/src/posix/os-types.h 2015-04-05 22:04:29.000000000 +0000 +++ platform-1.0.7/src/posix/os-types.h 2015-05-08 20:16:31.000000000 +0000 @@ -48,6 +48,10 @@ #include #include #include +#if defined(__APPLE__) +// for HRESULT +#include +#endif #define LIBTYPE #define DECLSPEC @@ -59,7 +63,9 @@ #define INVALID_SERIAL_SOCKET_VALUE (-1) typedef long LONG; +#if !defined(__APPLE__) typedef LONG HRESULT; +#endif #define _FILE_OFFSET_BITS 64 #define FILE_BEGIN 0 diff -Nru platform-1.0.0/src/sockets/socket.h platform-1.0.7/src/sockets/socket.h --- platform-1.0.0/src/sockets/socket.h 2015-04-05 22:04:29.000000000 +0000 +++ platform-1.0.7/src/sockets/socket.h 2015-05-08 20:16:31.000000000 +0000 @@ -32,13 +32,13 @@ */ #include "../threads/mutex.h" -#include "../util/StdString.h" #if defined(__WINDOWS__) #include "../windows/os-socket.h" #else #include "../posix/os-socket.h" #endif +#include // Common socket operations @@ -56,26 +56,26 @@ virtual bool IsOpen(void) = 0; virtual ssize_t Write(void* data, size_t len) = 0; virtual ssize_t Read(void* data, size_t len, uint64_t iTimeoutMs = 0) = 0; - virtual CStdString GetError(void) = 0; + virtual std::string GetError(void) = 0; virtual int GetErrorNumber(void) = 0; - virtual CStdString GetName(void) = 0; + virtual std::string GetName(void) = 0; }; template class CCommonSocket : public ISocket { public: - CCommonSocket(_SType initialSocketValue, const CStdString &strName) : + CCommonSocket(_SType initialSocketValue, const std::string &strName) : m_socket(initialSocketValue), m_strName(strName), m_iError(0) {} virtual ~CCommonSocket(void) {} - virtual CStdString GetError(void) + virtual std::string GetError(void) { - CStdString strError; - strError = m_strError.IsEmpty() && m_iError != 0 ? strerror(m_iError) : m_strError; + std::string strError; + strError = m_strError.empty() && m_iError != 0 ? strerror(m_iError) : m_strError; return strError; } @@ -84,19 +84,17 @@ return m_iError; } - virtual CStdString GetName(void) + virtual std::string GetName(void) { - CStdString strName; - strName = m_strName; - return strName; + return m_strName; } protected: - _SType m_socket; - CStdString m_strError; - CStdString m_strName; - int m_iError; - CMutex m_mutex; + _SType m_socket; + std::string m_strError; + std::string m_strName; + int m_iError; + CMutex m_mutex; }; template @@ -181,9 +179,9 @@ return iReturn; } - virtual CStdString GetError(void) + virtual std::string GetError(void) { - CStdString strError; + std::string strError; CLockObject lock(m_mutex); strError = m_socket ? m_socket->GetError() : ""; return strError; @@ -195,9 +193,9 @@ return m_socket ? m_socket->GetErrorNumber() : -EINVAL; } - virtual CStdString GetName(void) + virtual std::string GetName(void) { - CStdString strName; + std::string strName; CLockObject lock(m_mutex); strName = m_socket ? m_socket->GetName() : ""; return strName; diff -Nru platform-1.0.0/src/sockets/tcp.h platform-1.0.7/src/sockets/tcp.h --- platform-1.0.0/src/sockets/tcp.h 2015-04-05 22:04:29.000000000 +0000 +++ platform-1.0.7/src/sockets/tcp.h 2015-05-08 20:16:31.000000000 +0000 @@ -39,7 +39,7 @@ class CTcpSocket : public CCommonSocket { public: - CTcpSocket(const CStdString &strHostname, uint16_t iPort) : + CTcpSocket(const std::string &strHostname, uint16_t iPort) : CCommonSocket(INVALID_SOCKET_VALUE, strHostname), m_iPort(iPort) {} @@ -129,7 +129,7 @@ class CTcpConnection : public CProtectedSocket { public: - CTcpConnection(const CStdString &strHostname, uint16_t iPort) : + CTcpConnection(const std::string &strHostname, uint16_t iPort) : CProtectedSocket (new CTcpSocket(strHostname, iPort)) {} virtual ~CTcpConnection(void) {} }; diff -Nru platform-1.0.0/src/threads/mutex.h platform-1.0.7/src/threads/mutex.h --- platform-1.0.0/src/threads/mutex.h 2015-04-05 22:04:29.000000000 +0000 +++ platform-1.0.7/src/threads/mutex.h 2015-05-08 20:16:31.000000000 +0000 @@ -333,6 +333,12 @@ event.Wait(iTimeout); } + void Reset(void) + { + CLockObject lock(m_mutex); + m_bSignaled = false; + } + private: void Set(bool bBroadcast = false) { diff -Nru platform-1.0.0/UseMultiArch.cmake platform-1.0.7/UseMultiArch.cmake --- platform-1.0.0/UseMultiArch.cmake 2015-04-05 22:04:29.000000000 +0000 +++ platform-1.0.7/UseMultiArch.cmake 2015-05-08 20:16:31.000000000 +0000 @@ -14,7 +14,8 @@ # Fedora uses lib64/ for 64-bit systems, Debian uses lib/x86_64-linux-gnu; # Fedora put module files in lib64/ too, but Debian uses lib/ for that -if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") +if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux" AND + "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr") # Debian or Ubuntu? if (EXISTS "/etc/debian_version") set (_libdir_def "lib/${CMAKE_LIBRARY_ARCHITECTURE}") @@ -28,10 +29,10 @@ endif (CMAKE_SIZEOF_VOID_P EQUAL 8) set (_libdir_def "${_libdir_noarch}") endif (EXISTS "/etc/debian_version") -else ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") +else () set (_libdir_def "lib") set (_libdir_noarch "lib") -endif ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") +endif () # let the user override if somewhere else is desirable set (CMAKE_INSTALL_LIBDIR "${_libdir_def}" CACHE PATH "Object code libraries")