notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Compatibility with FreeBSD
[pcsx_rearmed.git]
/
deps
/
lightning
/
check
/
setcode.c
diff --git
a/deps/lightning/check/setcode.c
b/deps/lightning/check/setcode.c
index
62719ee
..
08611d9
100644
(file)
--- a/
deps/lightning/check/setcode.c
+++ b/
deps/lightning/check/setcode.c
@@
-31,14
+31,14
@@
main(int argc, char *argv[])
int mmap_fd;
#endif
void (*function)(void);
int mmap_fd;
#endif
void (*function)(void);
- int mmap_prot, mmap_flags;
+ int mmap_prot, mmap_flags
, result
;
#if defined(__sgi)
mmap_fd = open("/dev/zero", O_RDWR);
#endif
mmap_prot = PROT_READ | PROT_WRITE;
#if defined(__sgi)
mmap_fd = open("/dev/zero", O_RDWR);
#endif
mmap_prot = PROT_READ | PROT_WRITE;
-#if !
__OpenBSD__
+#if !
(__OpenBSD__ || __APPLE__)
mmap_prot |= PROT_EXEC;
#endif
#if __NetBSD__
mmap_prot |= PROT_EXEC;
#endif
#if __NetBSD__
@@
-83,7
+83,8
@@
main(int argc, char *argv[])
abort();
#if __NetBSD__
abort();
#if __NetBSD__
- assert(mprotect(ptr, 1024 * 1024, PROT_READ | PROT_WRITE) == 0);
+ result = mprotect(ptr, 1024 * 1024, PROT_READ | PROT_WRITE);
+ assert(result == 0);
#endif
/* and calling again with enough space works */
jit_set_code(ptr, 1024 * 1024);
#endif
/* and calling again with enough space works */
jit_set_code(ptr, 1024 * 1024);
@@
-92,8
+93,9
@@
main(int argc, char *argv[])
abort();
jit_clear_state();
abort();
jit_clear_state();
-#if __NetBSD__ || __OpenBSD__
- assert(mprotect(ptr, 1024 * 1024, PROT_READ | PROT_EXEC) == 0);
+#if __NetBSD__ || __OpenBSD__ || __APPLE__
+ result = mprotect(ptr, 1024 * 1024, PROT_READ | PROT_EXEC);
+ assert(result == 0);
#endif
(*function)();
jit_destroy_state();
#endif
(*function)();
jit_destroy_state();