diff options
author | Mike Pall <mike> | 2018-06-05 17:03:08 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2018-06-05 17:03:08 +0200 |
commit | c3c54ce1aef782823936808a75460e6b53aada2c (patch) | |
tree | 999dc989e25281bfc36ed8861d6f14b5d4e89786 /src/lj_arch.h | |
parent | a5a89ab586a3b5bb4f266949bbf3dc2b140e2374 (diff) | |
download | luajit-c3c54ce1aef782823936808a75460e6b53aada2c.tar.gz luajit-c3c54ce1aef782823936808a75460e6b53aada2c.tar.bz2 luajit-c3c54ce1aef782823936808a75460e6b53aada2c.zip |
Windows: Add UWP support, part 1.
Contributed by Ben Pye.
Diffstat (limited to 'src/lj_arch.h')
-rw-r--r-- | src/lj_arch.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lj_arch.h b/src/lj_arch.h index e796912e..31a11593 100644 --- a/src/lj_arch.h +++ b/src/lj_arch.h | |||
@@ -135,6 +135,13 @@ | |||
135 | #define LJ_TARGET_GC64 1 | 135 | #define LJ_TARGET_GC64 1 |
136 | #endif | 136 | #endif |
137 | 137 | ||
138 | #ifdef _UWP | ||
139 | #define LJ_TARGET_UWP 1 | ||
140 | #if LUAJIT_TARGET == LUAJIT_ARCH_X64 | ||
141 | #define LJ_TARGET_GC64 1 | ||
142 | #endif | ||
143 | #endif | ||
144 | |||
138 | #define LJ_NUMMODE_SINGLE 0 /* Single-number mode only. */ | 145 | #define LJ_NUMMODE_SINGLE 0 /* Single-number mode only. */ |
139 | #define LJ_NUMMODE_SINGLE_DUAL 1 /* Default to single-number mode. */ | 146 | #define LJ_NUMMODE_SINGLE_DUAL 1 /* Default to single-number mode. */ |
140 | #define LJ_NUMMODE_DUAL 2 /* Dual-number mode only. */ | 147 | #define LJ_NUMMODE_DUAL 2 /* Dual-number mode only. */ |
@@ -570,6 +577,18 @@ | |||
570 | #define LJ_NO_UNWIND 1 | 577 | #define LJ_NO_UNWIND 1 |
571 | #endif | 578 | #endif |
572 | 579 | ||
580 | #if LJ_TARGET_WINDOWS | ||
581 | #if LJ_TARGET_UWP | ||
582 | #define LJ_WIN_VALLOC VirtualAllocFromApp | ||
583 | #define LJ_WIN_VPROTECT VirtualProtectFromApp | ||
584 | extern void *LJ_WIN_LOADLIBA(const char *path); | ||
585 | #else | ||
586 | #define LJ_WIN_VALLOC VirtualAlloc | ||
587 | #define LJ_WIN_VPROTECT VirtualProtect | ||
588 | #define LJ_WIN_LOADLIBA(path) LoadLibraryExA((path), NULL, 0) | ||
589 | #endif | ||
590 | #endif | ||
591 | |||
573 | /* Compatibility with Lua 5.1 vs. 5.2. */ | 592 | /* Compatibility with Lua 5.1 vs. 5.2. */ |
574 | #ifdef LUAJIT_ENABLE_LUA52COMPAT | 593 | #ifdef LUAJIT_ENABLE_LUA52COMPAT |
575 | #define LJ_52 1 | 594 | #define LJ_52 1 |