diff --git a/CMakeLists.txt b/CMakeLists.txt index ef68f819..e7341bc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,7 +99,6 @@ set( IXWEBSOCKET_HEADERS ixwebsocket/IXWebSocketCloseConstants.h ixwebsocket/IXWebSocketCloseInfo.h ixwebsocket/IXWebSocketErrorInfo.h - ixwebsocket/IXWebsocketExport.h ixwebsocket/IXWebSocketHandshake.h ixwebsocket/IXWebSocketHandshakeKeyGen.h ixwebsocket/IXWebSocketHttpHeaders.h @@ -174,10 +173,6 @@ else() ${IXWEBSOCKET_SOURCES} ${IXWEBSOCKET_HEADERS} ) - - if( MSVC ) - target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_STATIC_DEFINE) - endif() endif() if (USE_TLS) @@ -291,7 +286,6 @@ if (IXWEBSOCKET_INSTALL) install(TARGETS ixwebsocket EXPORT ixwebsocket ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ixwebsocket/ ) diff --git a/ixwebsocket/IXDNSLookup.h b/ixwebsocket/IXDNSLookup.h index 89dcac36..fcdd103d 100644 --- a/ixwebsocket/IXDNSLookup.h +++ b/ixwebsocket/IXDNSLookup.h @@ -11,7 +11,6 @@ #pragma once #include "IXCancellationRequest.h" -#include "IXWebsocketExport.h" #include #include #include @@ -55,7 +54,7 @@ namespace ix std::string _hostname; int _port; int64_t _wait; - IXWEBSOCKET_EXPORT const static int64_t kDefaultWait; + const static int64_t kDefaultWait; struct addrinfo* _res; std::mutex _resMutex; diff --git a/ixwebsocket/IXHttpClient.h b/ixwebsocket/IXHttpClient.h index 969b4be6..c4b05845 100644 --- a/ixwebsocket/IXHttpClient.h +++ b/ixwebsocket/IXHttpClient.h @@ -10,7 +10,6 @@ #include "IXSocket.h" #include "IXSocketTLSOptions.h" #include "IXWebSocketHttpHeaders.h" -#include "IXWebsocketExport.h" #include #include #include @@ -92,12 +91,12 @@ namespace ix std::string urlEncode(const std::string& value); - IXWEBSOCKET_EXPORT const static std::string kPost; - IXWEBSOCKET_EXPORT const static std::string kGet; - IXWEBSOCKET_EXPORT const static std::string kHead; - IXWEBSOCKET_EXPORT const static std::string kDelete; - IXWEBSOCKET_EXPORT const static std::string kPut; - IXWEBSOCKET_EXPORT const static std::string kPatch; + const static std::string kPost; + const static std::string kGet; + const static std::string kHead; + const static std::string kDelete; + const static std::string kPut; + const static std::string kPatch; private: void log(const std::string& msg, HttpRequestArgsPtr args); diff --git a/ixwebsocket/IXHttpServer.h b/ixwebsocket/IXHttpServer.h index afab27ab..7de67631 100644 --- a/ixwebsocket/IXHttpServer.h +++ b/ixwebsocket/IXHttpServer.h @@ -9,7 +9,6 @@ #include "IXHttp.h" #include "IXSocketServer.h" #include "IXWebSocket.h" -#include "IXWebsocketExport.h" #include #include #include @@ -47,7 +46,7 @@ namespace ix OnConnectionCallback _onConnectionCallback; std::atomic _connectedClientsCount; - IXWEBSOCKET_EXPORT const static int kDefaultTimeoutSecs; + const static int kDefaultTimeoutSecs; int _timeoutSecs; // Methods diff --git a/ixwebsocket/IXSocketServer.h b/ixwebsocket/IXSocketServer.h index 0ccd93d7..fe0f7e28 100644 --- a/ixwebsocket/IXSocketServer.h +++ b/ixwebsocket/IXSocketServer.h @@ -10,7 +10,6 @@ #include "IXNetSystem.h" #include "IXSelectInterrupt.h" #include "IXSocketTLSOptions.h" -#include "IXWebsocketExport.h" #include #include #include @@ -49,11 +48,11 @@ namespace ix // that inherits from ConnectionState but has its own methods. void setConnectionStateFactory(const ConnectionStateFactory& connectionStateFactory); - IXWEBSOCKET_EXPORT const static int kDefaultPort; - IXWEBSOCKET_EXPORT const static std::string kDefaultHost; - IXWEBSOCKET_EXPORT const static int kDefaultTcpBacklog; - IXWEBSOCKET_EXPORT const static size_t kDefaultMaxConnections; - IXWEBSOCKET_EXPORT const static int kDefaultAddressFamily; + const static int kDefaultPort; + const static std::string kDefaultHost; + const static int kDefaultTcpBacklog; + const static size_t kDefaultMaxConnections; + const static int kDefaultAddressFamily; void start(); std::pair listen(); diff --git a/ixwebsocket/IXWebSocketCloseConstants.h b/ixwebsocket/IXWebSocketCloseConstants.h index 35ef3886..145777b9 100644 --- a/ixwebsocket/IXWebSocketCloseConstants.h +++ b/ixwebsocket/IXWebSocketCloseConstants.h @@ -6,7 +6,6 @@ #pragma once -#include "IXWebsocketExport.h" #include #include @@ -14,25 +13,25 @@ namespace ix { struct WebSocketCloseConstants { - IXWEBSOCKET_EXPORT static const uint16_t kNormalClosureCode; - IXWEBSOCKET_EXPORT static const uint16_t kInternalErrorCode; - IXWEBSOCKET_EXPORT static const uint16_t kAbnormalCloseCode; - IXWEBSOCKET_EXPORT static const uint16_t kProtocolErrorCode; - IXWEBSOCKET_EXPORT static const uint16_t kNoStatusCodeErrorCode; - IXWEBSOCKET_EXPORT static const uint16_t kInvalidFramePayloadData; + static const uint16_t kNormalClosureCode; + static const uint16_t kInternalErrorCode; + static const uint16_t kAbnormalCloseCode; + static const uint16_t kProtocolErrorCode; + static const uint16_t kNoStatusCodeErrorCode; + static const uint16_t kInvalidFramePayloadData; - IXWEBSOCKET_EXPORT static const std::string kNormalClosureMessage; - IXWEBSOCKET_EXPORT static const std::string kInternalErrorMessage; - IXWEBSOCKET_EXPORT static const std::string kAbnormalCloseMessage; - IXWEBSOCKET_EXPORT static const std::string kPingTimeoutMessage; - IXWEBSOCKET_EXPORT static const std::string kProtocolErrorMessage; - IXWEBSOCKET_EXPORT static const std::string kNoStatusCodeErrorMessage; - IXWEBSOCKET_EXPORT static const std::string kProtocolErrorReservedBitUsed; - IXWEBSOCKET_EXPORT static const std::string kProtocolErrorPingPayloadOversized; - IXWEBSOCKET_EXPORT static const std::string kProtocolErrorCodeControlMessageFragmented; - IXWEBSOCKET_EXPORT static const std::string kProtocolErrorCodeDataOpcodeOutOfSequence; - IXWEBSOCKET_EXPORT static const std::string kProtocolErrorCodeContinuationOpCodeOutOfSequence; - IXWEBSOCKET_EXPORT static const std::string kInvalidFramePayloadDataMessage; - IXWEBSOCKET_EXPORT static const std::string kInvalidCloseCodeMessage; + static const std::string kNormalClosureMessage; + static const std::string kInternalErrorMessage; + static const std::string kAbnormalCloseMessage; + static const std::string kPingTimeoutMessage; + static const std::string kProtocolErrorMessage; + static const std::string kNoStatusCodeErrorMessage; + static const std::string kProtocolErrorReservedBitUsed; + static const std::string kProtocolErrorPingPayloadOversized; + static const std::string kProtocolErrorCodeControlMessageFragmented; + static const std::string kProtocolErrorCodeDataOpcodeOutOfSequence; + static const std::string kProtocolErrorCodeContinuationOpCodeOutOfSequence; + static const std::string kInvalidFramePayloadDataMessage; + static const std::string kInvalidCloseCodeMessage; }; } // namespace ix diff --git a/ixwebsocket/IXWebSocketServer.h b/ixwebsocket/IXWebSocketServer.h index d4382c88..6cae6331 100644 --- a/ixwebsocket/IXWebSocketServer.h +++ b/ixwebsocket/IXWebSocketServer.h @@ -8,7 +8,6 @@ #include "IXSocketServer.h" #include "IXWebSocket.h" -#include "IXWebsocketExport.h" #include #include #include @@ -51,7 +50,7 @@ namespace ix void makeBroadcastServer(); bool listenAndStart(); - IXWEBSOCKET_EXPORT const static int kDefaultHandShakeTimeoutSecs; + const static int kDefaultHandShakeTimeoutSecs; int getHandshakeTimeoutSecs(); bool isPongEnabled(); @@ -68,7 +67,7 @@ namespace ix std::mutex _clientsMutex; std::set> _clients; - IXWEBSOCKET_EXPORT const static bool kDefaultEnablePong; + const static bool kDefaultEnablePong; // Methods virtual void handleConnection(std::unique_ptr socket, diff --git a/ixwebsocket/IXWebsocketExport.h b/ixwebsocket/IXWebsocketExport.h deleted file mode 100644 index 9de83a93..00000000 --- a/ixwebsocket/IXWebsocketExport.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef IXWEBSOCKET_EXPORT_H -#define IXWEBSOCKET_EXPORT_H - -#ifdef _WIN32 - -#ifdef IXWEBSOCKET_STATIC_DEFINE - /* Building and using static library */ -# define IXWEBSOCKET_EXPORT -# define IXWEBSOCKET_NO_EXPORT -#else -# ifndef IXWEBSOCKET_EXPORT -# ifdef ixwebsocket_EXPORTS /* Comes from cmake, documented in DEFINE_SYMBOL */ - /* Building dynamic library */ -# define IXWEBSOCKET_EXPORT __declspec(dllexport) -# else - /* Using dynamic library */ -# define IXWEBSOCKET_EXPORT __declspec(dllimport) -# endif -# endif - -# ifndef IXWEBSOCKET_NO_EXPORT -# define IXWEBSOCKET_NO_EXPORT -# endif -#endif - -#else /* _WIN32 */ - -# define IXWEBSOCKET_EXPORT -# define IXWEBSOCKET_NO_EXPORT - -#endif /* _WIN32 */ - -#endif /* IXWEBSOCKET_EXPORT_H */