Windows: Add UWP support, part 1.

Contributed by Ben Pye.
This commit is contained in:
Mike Pall
2018-06-05 17:03:08 +02:00
parent a5a89ab586
commit c3c54ce1ae
10 changed files with 78 additions and 20 deletions

View File

@@ -135,6 +135,13 @@
#define LJ_TARGET_GC64 1
#endif
#ifdef _UWP
#define LJ_TARGET_UWP 1
#if LUAJIT_TARGET == LUAJIT_ARCH_X64
#define LJ_TARGET_GC64 1
#endif
#endif
#define LJ_NUMMODE_SINGLE 0 /* Single-number mode only. */
#define LJ_NUMMODE_SINGLE_DUAL 1 /* Default to single-number mode. */
#define LJ_NUMMODE_DUAL 2 /* Dual-number mode only. */
@@ -570,6 +577,18 @@
#define LJ_NO_UNWIND 1
#endif
#if LJ_TARGET_WINDOWS
#if LJ_TARGET_UWP
#define LJ_WIN_VALLOC VirtualAllocFromApp
#define LJ_WIN_VPROTECT VirtualProtectFromApp
extern void *LJ_WIN_LOADLIBA(const char *path);
#else
#define LJ_WIN_VALLOC VirtualAlloc
#define LJ_WIN_VPROTECT VirtualProtect
#define LJ_WIN_LOADLIBA(path) LoadLibraryExA((path), NULL, 0)
#endif
#endif
/* Compatibility with Lua 5.1 vs. 5.2. */
#ifdef LUAJIT_ENABLE_LUA52COMPAT
#define LJ_52 1