1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-06 00:36:17 +00:00

Address windows compilation warning.

This commit is contained in:
Calvin Rose 2022-12-03 12:10:22 -06:00
parent 6c9c1cdb30
commit c731f01067

View File

@ -240,7 +240,7 @@ static JanetByteView janet_ffijit_getbytes(void *p, size_t s) {
JanetFFIJittedFn *fn = p; JanetFFIJittedFn *fn = p;
JanetByteView bytes; JanetByteView bytes;
bytes.bytes = fn->function_pointer; bytes.bytes = fn->function_pointer;
bytes.len = fn->size; bytes.len = (int32_t) fn->size;
return bytes; return bytes;
} }
@ -1299,6 +1299,7 @@ JANET_CORE_FN(cfun_ffi_jitfn,
void *ptr = mmap(0, bytes.len, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); void *ptr = mmap(0, bytes.len, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
#else #else
/* -std=c99 gets in the way */ /* -std=c99 gets in the way */
/* #define MAP_ANONYMOUS 0x20 should work, though. */
void *ptr = mmap(0, bytes.len, PROT_READ | PROT_WRITE, MAP_PRIVATE, -1, 0); void *ptr = mmap(0, bytes.len, PROT_READ | PROT_WRITE, MAP_PRIVATE, -1, 0);
#endif #endif
if (!ptr) { if (!ptr) {