mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
fixup for windows memory protection
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26732 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
bf8c928b7e
commit
7f1b63a68f
1 changed files with 5 additions and 5 deletions
|
@ -116,14 +116,14 @@
|
|||
*/
|
||||
- (void) protect
|
||||
{
|
||||
#if defined(HAVE_MPROTECT)
|
||||
if (mprotect(buffer, size, PROT_READ|PROT_EXEC) == -1)
|
||||
#if defined(__MINGW32__)
|
||||
DWORD old;
|
||||
if (VirtualProtect(buffer, size, PAGE_EXECUTE, &old) == 0)
|
||||
{
|
||||
NSLog(@"Failed to protect memory as executable: %@", [NSError _last]);
|
||||
}
|
||||
#elif defined(__MINGW32__)
|
||||
DWORD old;
|
||||
if (VirtualProtect(buffer, size, PAGE_EXECUTE, &old) == 0)
|
||||
#elif defined(HAVE_MPROTECT)
|
||||
if (mprotect(buffer, size, PROT_READ|PROT_EXEC) == -1)
|
||||
{
|
||||
NSLog(@"Failed to protect memory as executable: %@", [NSError _last]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue