diff --git a/CMakeLists.txt b/CMakeLists.txt index 87dbbb0..06c5866 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ set (SO_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}) # build options option(AMQP-CPP_BUILD_SHARED "Build shared library. If off, build will be static." OFF) -option(AMQP-CPP_LINUX_TCP "Build linux sockets implementation." OFF) +option(AMQP-CPP_LINUX_TCP "Build linux sockets implementation." ON) option(AMQP-CPP_BUILD_EXAMPLES "Build amqpcpp examples" OFF) # ensure c++11 on all compilers @@ -115,3 +115,9 @@ set(PRIVATE_LIBS "-llibamqpcc") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/amqpcpp.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/amqpcpp.pc" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/amqpcpp.pc" DESTINATION lib/pkgconfig) + +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $ +) +target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS}) diff --git a/include/amqpcpp/libboostasio.h b/include/amqpcpp/libboostasio.h index c1492f5..68daf20 100644 --- a/include/amqpcpp/libboostasio.h +++ b/include/amqpcpp/libboostasio.h @@ -176,7 +176,7 @@ protected: * @note The handler will get called if a read is cancelled. */ void read_handler(const boost::system::error_code &ec, - const std::size_t bytes_transferred, + const std::size_t, const std::weak_ptr awpWatcher, TcpConnection *const connection, const int fd) @@ -210,7 +210,7 @@ protected: * @note The handler will get called if a write is cancelled. */ void write_handler(const boost::system::error_code ec, - const std::size_t bytes_transferred, + const std::size_t, const std::weak_ptr awpWatcher, TcpConnection *const connection, const int fd) diff --git a/include/amqpcpp/linux_tcp/tcphandler.h b/include/amqpcpp/linux_tcp/tcphandler.h index 9b0c87d..08ffc0f 100644 --- a/include/amqpcpp/linux_tcp/tcphandler.h +++ b/include/amqpcpp/linux_tcp/tcphandler.h @@ -56,7 +56,7 @@ public: * @param ssl Pointer to the SSL structure that can be inspected * @return bool True to proceed / accept the connection, false to break up */ - virtual bool onSecured(TcpConnection *connection, const SSL *ssl) + virtual bool onSecured(TcpConnection *, const SSL *) { // default implementation: do not inspect anything, just allow the connection return true; @@ -73,7 +73,7 @@ public: * * @see ConnectionHandler::onNegotiate */ - virtual uint16_t onNegotiate(TcpConnection *connection, uint16_t interval) + virtual uint16_t onNegotiate(TcpConnection *, uint16_t interval) { // default implementation, suggested heartbeat is ok return interval; @@ -85,7 +85,7 @@ public: * secure TLS connection, and the AMQP login handshake has been completed. * @param connection The TCP connection */ - virtual void onConnected(TcpConnection *connection) {} + virtual void onConnected(TcpConnection *) {} /** * Method that is called when the server sends a heartbeat to the client @@ -93,20 +93,20 @@ public: * * @see ConnectionHandler::onHeartbeat */ - virtual void onHeartbeat(TcpConnection *connection) {} + virtual void onHeartbeat(TcpConnection *) {} /** * Method that is called when the TCP connection ends up in an error state * @param connection The TCP connection * @param message Error message */ - virtual void onError(TcpConnection *connection, const char *message) {} + virtual void onError(TcpConnection *, const char *) {} /** * Method that is called when the TCP connection is closed * @param connection The TCP connection */ - virtual void onClosed(TcpConnection *connection) {} + virtual void onClosed(TcpConnection *) {} /** * Monitor a filedescriptor for readability or writability diff --git a/src/linux_tcp/pipe.h b/src/linux_tcp/pipe.h index d374d7b..c7b4464 100644 --- a/src/linux_tcp/pipe.h +++ b/src/linux_tcp/pipe.h @@ -82,7 +82,8 @@ public: char byte = 0; // send one byte over the pipe - this will wake up the other thread - write(_fds[1], &byte, 1); + if (write(_fds[1], &byte, 1) == -1) + throw std::runtime_error(strerror(errno)); } };