summaryrefslogtreecommitdiff
path: root/ujit_asm.c
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2020-10-05 07:41:46 -0400
committerAlan Wu <[email protected]>2021-10-20 18:19:24 -0400
commit7d1546ece5e3678a8b8eb196c81c3f4972c51f0a (patch)
treee0e6900959791ebe4d460c4823f4a16ec28baa5e /ujit_asm.c
parenta3e58f4df827f36681e4fdebfef8e05a6ceb5c10 (diff)
Try to fix Windows build
Diffstat (limited to 'ujit_asm.c')
-rw-r--r--ujit_asm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ujit_asm.c b/ujit_asm.c
index 8efbee3f79..e8aee15fab 100644
--- a/ujit_asm.c
+++ b/ujit_asm.c
@@ -3,8 +3,10 @@
#include <stdarg.h>
#include <assert.h>
+#ifndef _WIN32
// For mmapp()
#include <sys/mman.h>
+#endif
#include "ujit_asm.h"
@@ -82,6 +84,7 @@ x86opnd_t const_ptr_opnd(void* ptr)
// Allocate a block of executable memory
uint8_t* alloc_exec_mem(size_t mem_size)
{
+#ifndef _WIN32
// Map the memory as executable
uint8_t* mem_block = (uint8_t*)mmap(
&alloc_exec_mem,
@@ -100,6 +103,9 @@ uint8_t* alloc_exec_mem(size_t mem_size)
}
return mem_block;
+#else
+ return NULL;
+#endif
}
// Initialize a code block object