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:
Richard Frith-MacDonald 2008-06-29 19:21:15 +00:00
parent bf8c928b7e
commit 7f1b63a68f

View file

@ -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]);
}