diff options
Diffstat (limited to 'src/lj_dispatch.h')
-rw-r--r-- | src/lj_dispatch.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lj_dispatch.h b/src/lj_dispatch.h index 3ba983a8..dd4f68fe 100644 --- a/src/lj_dispatch.h +++ b/src/lj_dispatch.h | |||
@@ -69,4 +69,21 @@ LJ_FUNCA void LJ_FASTCALL lj_dispatch_ins(lua_State *L, const BCIns *pc); | |||
69 | LJ_FUNCA ASMFunction LJ_FASTCALL lj_dispatch_call(lua_State *L, const BCIns*pc); | 69 | LJ_FUNCA ASMFunction LJ_FASTCALL lj_dispatch_call(lua_State *L, const BCIns*pc); |
70 | LJ_FUNCA void LJ_FASTCALL lj_dispatch_return(lua_State *L, const BCIns *pc); | 70 | LJ_FUNCA void LJ_FASTCALL lj_dispatch_return(lua_State *L, const BCIns *pc); |
71 | 71 | ||
72 | #if LJ_HASFFI && !defined(_BUILDVM_H) | ||
73 | /* Save/restore errno and GetLastError() around hooks, exits and recording. */ | ||
74 | #include <errno.h> | ||
75 | #if LJ_TARGET_WINDOWS | ||
76 | #define WIN32_LEAN_AND_MEAN | ||
77 | #include <windows.h> | ||
78 | #define ERRNO_SAVE int olderr = errno; DWORD oldwerr = GetLastError(); | ||
79 | #define ERRNO_RESTORE errno = olderr; SetLastError(oldwerr); | ||
80 | #else | ||
81 | #define ERRNO_SAVE int olderr = errno; | ||
82 | #define ERRNO_RESTORE errno = olderr; | ||
83 | #endif | ||
84 | #else | ||
85 | #define ERRNO_SAVE | ||
86 | #define ERRNO_RESTORE | ||
87 | #endif | ||
88 | |||
72 | #endif | 89 | #endif |