mirror of https://github.com/oxen-io/lokinet
crash on wine, we support linux, ucb_unix, svr4
natively ffs. i tested this patch on wine 4.4 on fuckin Solaris 11 snv_151pull/914/head
parent
f8c6c1379a
commit
cf3469e11a
@ -0,0 +1,34 @@
|
||||
#include <util/lokinet_init.h>
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#include <winuser.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
Lokinet_INIT(void)
|
||||
{
|
||||
static const char *(CDECL * pwine_get_version)(void);
|
||||
HMODULE hntdll = GetModuleHandle("ntdll.dll");
|
||||
if(hntdll)
|
||||
{
|
||||
pwine_get_version = (void *)GetProcAddress(hntdll, "wine_get_version");
|
||||
if(pwine_get_version)
|
||||
{
|
||||
static const char *text =
|
||||
"dont run lokinet in wine like wtf man we support linux and pretty "
|
||||
"much every flavor of BSD.\nThis Program Will now crash lmao.";
|
||||
static const char *title = "srsly fam wtf";
|
||||
MessageBoxA(NULL, text, title, MB_ICONEXCLAMATION | MB_OK);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int
|
||||
Lokinet_INIT(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,24 @@
|
||||
#ifndef LLARP_UTIL_LOKINET_INIT_H
|
||||
#define LLARP_UTIL_LOKINET_INIT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#ifndef Lokinet_INIT
|
||||
#if defined(_WIN32)
|
||||
#define Lokinet_INIT \
|
||||
DieInCaseSomehowThisGetsRunInWineButLikeWTFThatShouldNotHappenButJustInCaseHandleItWithAPopupOrSomeShit
|
||||
#else
|
||||
#define Lokinet_INIT _lokinet_non_shit_platform_INIT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int
|
||||
Lokinet_INIT(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
Loading…
Reference in New Issue