From b29f16fea1b70676f0b9d5baad7cea86d90a2cf1 Mon Sep 17 00:00:00 2001 From: TechStudent10 Date: Tue, 10 Dec 2024 19:37:23 -0700 Subject: [PATCH] export some symbols --- CMakeLists.txt | 2 ++ src/defs.hpp | 9 +++++++++ src/layers/Lobby.hpp | 6 ++++-- src/layers/LobbySelectPopup.hpp | 3 ++- src/managers/AuthManager.hpp | 4 +++- src/managers/SwapManager.hpp | 4 +++- src/network/manager.hpp | 5 ++++- src/network/packets/packet.hpp | 4 +++- 8 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 src/defs.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a51338..f7d699c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,8 @@ if (WIN32) endif() endif() +target_compile_definitions(${PROJECT_NAME} PRIVATE CR_EXPORTING) + target_include_directories(${PROJECT_NAME} PRIVATE ${ixwebsocket_SOURCE_DIR}) target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/ext/cereal/include") diff --git a/src/defs.hpp b/src/defs.hpp new file mode 100644 index 0000000..e81459f --- /dev/null +++ b/src/defs.hpp @@ -0,0 +1,9 @@ +#ifdef GEODE_IS_WINDOWS + #ifdef CR_EXPORTING + #define CR_DLL __declspec(dllexport) + #else + #define CR_DLL __declspec(dllimport) + #endif +#else + #define CR_DLL +#endif \ No newline at end of file diff --git a/src/layers/Lobby.hpp b/src/layers/Lobby.hpp index 0266ea4..3487afb 100755 --- a/src/layers/Lobby.hpp +++ b/src/layers/Lobby.hpp @@ -1,9 +1,11 @@ #include #include +#include + using namespace geode::prelude; -class PlayerCell : public CCLayer { +class CR_DLL PlayerCell : public CCLayer { protected: Account m_account; @@ -14,7 +16,7 @@ class PlayerCell : public CCLayer { static PlayerCell* create(Account account, float width, bool canKick); }; -class LobbyLayer : public CCLayer { +class CR_DLL LobbyLayer : public CCLayer { protected: std::string lobbyCode; bool isOwner = false; diff --git a/src/layers/LobbySelectPopup.hpp b/src/layers/LobbySelectPopup.hpp index 7c98599..1828e44 100755 --- a/src/layers/LobbySelectPopup.hpp +++ b/src/layers/LobbySelectPopup.hpp @@ -1,9 +1,10 @@ #pragma once #include +#include using namespace geode::prelude; -class LobbySelectPopup : public geode::Popup<> { +class CR_DLL LobbySelectPopup : public geode::Popup<> { protected: Border* lobbyList; diff --git a/src/managers/AuthManager.hpp b/src/managers/AuthManager.hpp index 01e01cd..ef6e82d 100755 --- a/src/managers/AuthManager.hpp +++ b/src/managers/AuthManager.hpp @@ -4,9 +4,11 @@ #include #include +#include + using namespace geode::prelude; -class AuthManager : public UploadMessageDelegate { +class CR_DLL AuthManager : public UploadMessageDelegate { public: static AuthManager& get() { static AuthManager instance; diff --git a/src/managers/SwapManager.hpp b/src/managers/SwapManager.hpp index 3c58d1b..704d9d8 100755 --- a/src/managers/SwapManager.hpp +++ b/src/managers/SwapManager.hpp @@ -5,7 +5,9 @@ #include #include -class SwapManager { +#include + +class CR_DLL SwapManager { public: static SwapManager& get() { static SwapManager instance; diff --git a/src/network/manager.hpp b/src/network/manager.hpp index 0ec0dbd..f6e1952 100755 --- a/src/network/manager.hpp +++ b/src/network/manager.hpp @@ -10,12 +10,15 @@ #include #include + +#include + using namespace geode::prelude; using DisconnectCallback = std::function; using MiddlewareCb = std::function callback)>; -class NetworkManager : public CCObject { +class CR_DLL NetworkManager : public CCObject { public: static NetworkManager& get() { static NetworkManager instance; diff --git a/src/network/packets/packet.hpp b/src/network/packets/packet.hpp index 4cc4ef6..44f9271 100755 --- a/src/network/packets/packet.hpp +++ b/src/network/packets/packet.hpp @@ -2,6 +2,8 @@ #include #include +#include + #define CR_ARGS(...) __VA_ARGS__ #define CR_PACKET(id, name) \ @@ -19,7 +21,7 @@ } \ name() {} -class Packet { +class CR_DLL Packet { public: static const int PACKET_ID = 0000;