Use pre-existing ERRNO_SAVE / ERRNO_RESTORE if defined

This commit is contained in:
Matt Messier 2023-01-12 08:12:42 -05:00
parent d0e88930dd
commit 20876a5bb8

View File

@ -144,6 +144,7 @@ LJ_FUNCA void LJ_FASTCALL lj_dispatch_stitch(jit_State *J, const BCIns *pc);
LJ_FUNCA void LJ_FASTCALL lj_dispatch_profile(lua_State *L, const BCIns *pc); LJ_FUNCA void LJ_FASTCALL lj_dispatch_profile(lua_State *L, const BCIns *pc);
#endif #endif
#if !defined(ERRNO_SAVE) && !defined(ERRNO_RESTORE)
#if LJ_HASFFI && !defined(_BUILDVM_H) #if LJ_HASFFI && !defined(_BUILDVM_H)
/* Save/restore errno and GetLastError() around hooks, exits and recording. */ /* Save/restore errno and GetLastError() around hooks, exits and recording. */
#include <errno.h> #include <errno.h>
@ -160,5 +161,6 @@ LJ_FUNCA void LJ_FASTCALL lj_dispatch_profile(lua_State *L, const BCIns *pc);
#define ERRNO_SAVE #define ERRNO_SAVE
#define ERRNO_RESTORE #define ERRNO_RESTORE
#endif #endif
#endif
#endif #endif