mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +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
703aff6ef5
commit
a12a537b6f
1 changed files with 5 additions and 5 deletions
|
@ -116,14 +116,14 @@
|
||||||
*/
|
*/
|
||||||
- (void) protect
|
- (void) protect
|
||||||
{
|
{
|
||||||
#if defined(HAVE_MPROTECT)
|
#if defined(__MINGW32__)
|
||||||
if (mprotect(buffer, size, PROT_READ|PROT_EXEC) == -1)
|
DWORD old;
|
||||||
|
if (VirtualProtect(buffer, size, PAGE_EXECUTE, &old) == 0)
|
||||||
{
|
{
|
||||||
NSLog(@"Failed to protect memory as executable: %@", [NSError _last]);
|
NSLog(@"Failed to protect memory as executable: %@", [NSError _last]);
|
||||||
}
|
}
|
||||||
#elif defined(__MINGW32__)
|
#elif defined(HAVE_MPROTECT)
|
||||||
DWORD old;
|
if (mprotect(buffer, size, PROT_READ|PROT_EXEC) == -1)
|
||||||
if (VirtualProtect(buffer, size, PAGE_EXECUTE, &old) == 0)
|
|
||||||
{
|
{
|
||||||
NSLog(@"Failed to protect memory as executable: %@", [NSError _last]);
|
NSLog(@"Failed to protect memory as executable: %@", [NSError _last]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue