Make it build under linux again
This commit is contained in:
@@ -221,9 +221,12 @@ static int console_read(char *bytes, int nbytes) {
|
||||
|
||||
static void call_init_engine_wrapper(EngineWrapper *w) {
|
||||
using InitFn = void (*)(EngineWrapper *);
|
||||
void *dll_handle = dlopen("./luprex.so", RTLD_NOW | RTLD_LOCAL);
|
||||
assert(dll_handle != nullptr);
|
||||
InitFn initfn = (InitFn)dlsym(dll_handle, "init_engine_wrapper");
|
||||
InitFn initfn = (InitFn)dlsym(nullptr, "init_engine_wrapper");
|
||||
if (initfn == nullptr) {
|
||||
void *dll_handle = dlopen("./luprexlib.so", RTLD_NOW | RTLD_LOCAL);
|
||||
assert(dll_handle != nullptr);
|
||||
initfn = (InitFn)dlsym(dll_handle, "init_engine_wrapper");
|
||||
}
|
||||
assert(initfn != nullptr);
|
||||
initfn(w);
|
||||
}
|
||||
@@ -242,16 +245,9 @@ static void disable_randomization(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
#include "driver-common.cpp"
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
static void os_initialize(int argc, char **argv) {
|
||||
disable_randomization(argc, argv);
|
||||
enable_tty_raw();
|
||||
assert(OPENSSL_init_ssl(0, NULL) == 1);
|
||||
sslutil::clear_all_errors();
|
||||
Driver driver;
|
||||
return driver.drive(argc, argv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -291,14 +291,7 @@ static void call_init_engine_wrapper(EngineWrapper *w) {
|
||||
initfn(w);
|
||||
}
|
||||
|
||||
#include "driver-common.cpp"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
void os_initialize(int argc, char **argv) {
|
||||
init_winsock();
|
||||
assert(OPENSSL_init_ssl(0, NULL) == 1);
|
||||
sslutil::clear_all_errors();
|
||||
Driver driver;
|
||||
return driver.drive(argc, argv);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
|
||||
#if defined(__linux__)
|
||||
#include "driver-linux.cpp"
|
||||
#elif defined(WIN32)
|
||||
#include "driver-windows.cpp"
|
||||
#endif
|
||||
|
||||
#define POLLVEC_SIZE (DRV_MAX_CHAN + 1)
|
||||
#define MAX_BIO_BUFFER (128 * 1024)
|
||||
|
||||
@@ -628,3 +635,12 @@ class Driver {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
os_initialize(argc, argv);
|
||||
assert(OPENSSL_init_ssl(0, NULL) == 1);
|
||||
sslutil::clear_all_errors();
|
||||
Driver driver;
|
||||
return driver.drive(argc, argv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user