Skip to content

Commit

Permalink
export some symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
TechStudent10 committed Dec 11, 2024
1 parent a23b5aa commit b29f16f
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
9 changes: 9 additions & 0 deletions src/defs.hpp
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions src/layers/Lobby.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include <Geode/Geode.hpp>
#include <types/lobby.hpp>

#include <defs.hpp>

using namespace geode::prelude;

class PlayerCell : public CCLayer {
class CR_DLL PlayerCell : public CCLayer {
protected:
Account m_account;

Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/layers/LobbySelectPopup.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once
#include <Geode/Geode.hpp>
#include <defs.hpp>

using namespace geode::prelude;

class LobbySelectPopup : public geode::Popup<> {
class CR_DLL LobbySelectPopup : public geode::Popup<> {
protected:
Border* lobbyList;

Expand Down
4 changes: 3 additions & 1 deletion src/managers/AuthManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
#include <network/packets/client.hpp>
#include <network/packets/server.hpp>

#include <defs.hpp>

using namespace geode::prelude;

class AuthManager : public UploadMessageDelegate {
class CR_DLL AuthManager : public UploadMessageDelegate {
public:
static AuthManager& get() {
static AuthManager instance;
Expand Down
4 changes: 3 additions & 1 deletion src/managers/SwapManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#include <network/packets/client.hpp>
#include <network/packets/server.hpp>

class SwapManager {
#include <defs.hpp>

class CR_DLL SwapManager {
public:
static SwapManager& get() {
static SwapManager instance;
Expand Down
5 changes: 4 additions & 1 deletion src/network/manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@

#include <Geode/Geode.hpp>
#include <matjson.hpp>

#include <defs.hpp>

using namespace geode::prelude;

using DisconnectCallback = std::function<void(std::string)>;
using MiddlewareCb = std::function<void(std::function<void()> callback)>;

class NetworkManager : public CCObject {
class CR_DLL NetworkManager : public CCObject {
public:
static NetworkManager& get() {
static NetworkManager instance;
Expand Down
4 changes: 3 additions & 1 deletion src/network/packets/packet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include <string>
#include <serialization.hpp>

#include <defs.hpp>

#define CR_ARGS(...) __VA_ARGS__

#define CR_PACKET(id, name) \
Expand All @@ -19,7 +21,7 @@
} \
name() {}

class Packet {
class CR_DLL Packet {
public:
static const int PACKET_ID = 0000;

Expand Down

0 comments on commit b29f16f

Please sign in to comment.