Visual studio version is working

This commit is contained in:
2023-05-09 22:12:17 -04:00
parent 48628655fc
commit b42393bbac
5 changed files with 138 additions and 95 deletions

View File

@@ -14,14 +14,6 @@
#include <charconv>
#ifdef WIN32
#endif
#ifndef WIN32
#include <time.h>
#include <unistd.h>
#endif
namespace sv {
bool case_insensitive_eq(string_view s1, string_view s2) {

View File

@@ -279,10 +279,14 @@ static void ssl_load_certificate_authorities(SSL_CTX *ctx) {
}
static void call_init_engine_wrapper(EngineWrapper *w) {
HMODULE dll = LoadLibraryA(".\\luprex.dll");
assert(dll != nullptr);
HMODULE exe = GetModuleHandleA(NULL);
using InitFn = void (*)(EngineWrapper *);
InitFn initfn = (InitFn)GetProcAddress(dll, "init_engine_wrapper");
InitFn initfn = (InitFn)GetProcAddress(exe, "init_engine_wrapper");
if (initfn == nullptr) {
HMODULE dll = LoadLibraryA(".\\luprexlib.dll");
assert(dll != nullptr);
initfn = (InitFn)GetProcAddress(dll, "init_engine_wrapper");
}
assert(initfn != nullptr);
initfn(w);
}

View File

@@ -10,6 +10,7 @@
#include <iostream>
#if defined(_WIN32)
#include <windows.h>
#include <profileapi.h>
#elif defined(__linux__)
#include <time.h>