mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-06 15:51:25 +00:00
well, that was interesting: turns out mingw provides mprotect and
getpagesize :/
This commit is contained in:
parent
c38ca8e2f1
commit
6f022f5d9f
1 changed files with 8 additions and 8 deletions
|
@ -234,6 +234,13 @@ Sys_DoubleTime (void)
|
|||
void
|
||||
Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
DWORD flOldProtect;
|
||||
|
||||
if (!VirtualProtect
|
||||
((LPVOID) startaddr, length, PAGE_READWRITE,
|
||||
&flOldProtect)) Sys_Error ("Protection change failed\n");
|
||||
#else
|
||||
# ifdef HAVE_MPROTECT
|
||||
int r;
|
||||
unsigned long addr;
|
||||
|
@ -248,13 +255,6 @@ Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
|
|||
|
||||
if (r < 0)
|
||||
Sys_Error ("Protection change failed\n");
|
||||
#else
|
||||
# ifdef HAVE_VIRTUALPROTECT
|
||||
DWORD flOldProtect;
|
||||
|
||||
if (!VirtualProtect
|
||||
((LPVOID) startaddr, length, PAGE_READWRITE,
|
||||
&flOldProtect)) Sys_Error ("Protection change failed\n");
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue