Skip to content

Commit 89e0aba

Browse files
committed
feat: misc updates
1 parent eef64b1 commit 89e0aba

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

include/SFSE/API.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ namespace SFSE
1818
const char* logPattern{ nullptr };
1919
bool trampoline{ false };
2020
std::size_t trampolineSize{ 0 };
21-
bool trampolineSFSE{ true };
2221
bool hook{ true };
2322
};
2423

@@ -42,7 +41,8 @@ namespace SFSE
4241

4342
namespace SFSE
4443
{
44+
// DEPRECATED
4545
void Init(const LoadInterface* a_intfc, bool a_log) noexcept;
46-
46+
// DEPRECATED
4747
void AllocTrampoline(std::size_t a_size, bool a_trySFSEReserve = true) noexcept;
4848
}

include/SFSE/Interfaces.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ namespace SFSE
344344
static_assert(sizeof(PluginVersionData) == 0x25C);
345345
}
346346

347-
#define SFSEPluginPreload(...) extern "C" [[maybe_unused]] __declspec(dllexport) bool SFSEPlugin_Preload(__VA_ARGS__)
348-
#define SFSEPluginLoad(...) extern "C" [[maybe_unused]] __declspec(dllexport) bool SFSEPlugin_Load(__VA_ARGS__)
349-
#define SFSEPluginVersion extern "C" [[maybe_unused]] __declspec(dllexport) constinit SFSE::PluginVersionData SFSEPlugin_Version
347+
#define SFSE_EXPORT extern "C" [[maybe_unused]] __declspec(dllexport)
348+
#define SFSE_PLUGIN_PRELOAD(...) SFSE_EXPORT bool SFSEPlugin_Preload(__VA_ARGS__)
349+
#define SFSE_PLUGIN_LOAD(...) SFSE_EXPORT bool SFSEPlugin_Load(__VA_ARGS__)
350+
#define SFSE_PLUGIN_VERSION SFSE_EXPORT constinit SFSE::PluginVersionData SFSEPlugin_Version
351+
#define SFSEPluginPreload OBSE_PLUGIN_PRELOAD
352+
#define SFSEPluginLoad OBSE_PLUGIN_LOAD
353+
#define SFSEPluginVersion OBSE_PLUGIN_VERSION

src/SFSE/API.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ namespace SFSE
108108
}
109109

110110
auto& trampoline = REL::GetTrampoline();
111-
if (const auto intfc = GetTrampolineInterface();
112-
intfc && info.trampolineSFSE) {
111+
if (const auto intfc = GetTrampolineInterface()) {
113112
if (const auto mem = intfc->AllocateFromBranchPool(info.trampolineSize))
114113
trampoline.set_trampoline(mem, info.trampolineSize);
115114
else
@@ -250,12 +249,11 @@ namespace SFSE
250249
Init(a_intfc, { .log = a_log });
251250
}
252251

253-
void AllocTrampoline(std::size_t a_size, bool a_trySFSEReserve) noexcept
252+
void AllocTrampoline(std::size_t a_size, bool) noexcept
254253
{
255254
auto api = Impl::API::GetSingleton();
256255
api->info.trampoline = true;
257256
api->info.trampolineSize = a_size;
258-
api->info.trampolineSFSE = a_trySFSEReserve;
259257
api->InitTrampoline();
260258
}
261259
}

xmake-rules.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@
1515

1616
local PLUGIN_FILE = [[
1717
#include <SFSE/SFSE.h>
18-
#include <REL/Relocation.h>
19-
20-
using namespace std::literals;
21-
22-
extern "C" __declspec(dllexport)
23-
constinit auto SFSEPlugin_Version = []() noexcept {
18+
SFSE_EXPORT constinit auto SFSEPlugin_Version = []() noexcept {
2419
SFSE::PluginVersionData v{};
2520
v.PluginVersion({ ${PLUGIN_VERSION_MAJOR}, ${PLUGIN_VERSION_MINOR}, ${PLUGIN_VERSION_PATCH} });
2621
v.PluginName("${PLUGIN_NAME}");

0 commit comments

Comments
 (0)