From d8882e71f4a4336d0a0f6aa52d716d943eaa0eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Sat, 8 Aug 2020 16:36:45 +0200 Subject: [PATCH 1/2] sockets: export classes --- src/ActiveSocket.h | 2 +- src/Host.h | 6 ++++++ src/PassiveSocket.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ActiveSocket.h b/src/ActiveSocket.h index e452098..14e0ad9 100644 --- a/src/ActiveSocket.h +++ b/src/ActiveSocket.h @@ -51,7 +51,7 @@ class CPassiveSocket; /// An active socket is used to create a socket which connects to a server. /// This type of object would be used when an application needs to send/receive /// data from a server. -class CActiveSocket : public CSimpleSocket { +class EXPORT CActiveSocket : public CSimpleSocket { public: friend class CPassiveSocket; diff --git a/src/Host.h b/src/Host.h index 9eaaba1..91b3d16 100644 --- a/src/Host.h +++ b/src/Host.h @@ -250,6 +250,12 @@ extern "C" #define FPRINTF fprintf #endif +#ifdef _MSC_VER + #define EXPORT __declspec(dllexport) +#else + #define EXPORT +#endif + #ifdef __cplusplus } #endif diff --git a/src/PassiveSocket.h b/src/PassiveSocket.h index a5f4fd1..e958777 100644 --- a/src/PassiveSocket.h +++ b/src/PassiveSocket.h @@ -52,7 +52,7 @@ /// in a similar fashion. The big difference is that the method /// CPassiveSocket::Accept should not be called on the latter two socket /// types. -class CPassiveSocket : public CSimpleSocket { +class EXPORT CPassiveSocket : public CSimpleSocket { public: CPassiveSocket(CSocketType type = SocketTypeTcp); virtual ~CPassiveSocket() { From 19a37c60f1a5e2a3527b9d99dbce49a478050fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Sat, 8 Aug 2020 16:55:25 +0200 Subject: [PATCH 2/2] export SimpleSocket and StatTimer --- src/SimpleSocket.h | 2 +- src/StatTimer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SimpleSocket.h b/src/SimpleSocket.h index 603f467..4a5a9be 100644 --- a/src/SimpleSocket.h +++ b/src/SimpleSocket.h @@ -99,7 +99,7 @@ /// - Socket types /// -# CActiveSocket Class /// -# CPassiveSocket Class -class CSimpleSocket { +class EXPORT CSimpleSocket { public: /// Defines the three possible states for shuting down a socket. typedef enum diff --git a/src/StatTimer.h b/src/StatTimer.h index 2110add..c8097b1 100644 --- a/src/StatTimer.h +++ b/src/StatTimer.h @@ -68,7 +68,7 @@ /// Class to abstract socket communications in a cross platform manner. /// This class is designed -class CStatTimer { +class EXPORT CStatTimer { public: CStatTimer() {