diff options
-rw-r--r-- | src/lj_alloc.c | 2 | ||||
-rw-r--r-- | src/lj_arch.h | 6 | ||||
-rw-r--r-- | src/lj_err.c | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/lj_alloc.c b/src/lj_alloc.c index 7c7ec678..9218c440 100644 --- a/src/lj_alloc.c +++ b/src/lj_alloc.c | |||
@@ -194,7 +194,7 @@ static LJ_AINLINE void *CALL_MMAP(size_t size) | |||
194 | return ptr; | 194 | return ptr; |
195 | } | 195 | } |
196 | 196 | ||
197 | #elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__) | 197 | #elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__) || defined(__CYGWIN__) |
198 | 198 | ||
199 | /* OSX and FreeBSD mmap() use a naive first-fit linear search. | 199 | /* OSX and FreeBSD mmap() use a naive first-fit linear search. |
200 | ** That's perfect for us. Except that -pagezero_size must be set for OSX, | 200 | ** That's perfect for us. Except that -pagezero_size must be set for OSX, |
diff --git a/src/lj_arch.h b/src/lj_arch.h index d89d1169..9a6d4305 100644 --- a/src/lj_arch.h +++ b/src/lj_arch.h | |||
@@ -151,7 +151,11 @@ | |||
151 | #define LJ_ARCH_NAME "x64" | 151 | #define LJ_ARCH_NAME "x64" |
152 | #define LJ_ARCH_BITS 64 | 152 | #define LJ_ARCH_BITS 64 |
153 | #define LJ_ARCH_ENDIAN LUAJIT_LE | 153 | #define LJ_ARCH_ENDIAN LUAJIT_LE |
154 | #define LJ_ABI_WIN LJ_TARGET_WINDOWS | 154 | #if LJ_TARGET_WINDOWS || __CYGWIN__ |
155 | #define LJ_ABI_WIN 1 | ||
156 | #else | ||
157 | #define LJ_ABI_WIN 0 | ||
158 | #endif | ||
155 | #define LJ_TARGET_X64 1 | 159 | #define LJ_TARGET_X64 1 |
156 | #define LJ_TARGET_X86ORX64 1 | 160 | #define LJ_TARGET_X86ORX64 1 |
157 | #define LJ_TARGET_EHRETREG 0 | 161 | #define LJ_TARGET_EHRETREG 0 |
diff --git a/src/lj_err.c b/src/lj_err.c index 11b07b56..6d8519bb 100644 --- a/src/lj_err.c +++ b/src/lj_err.c | |||
@@ -186,7 +186,7 @@ static void *err_unwind(lua_State *L, void *stopcf, int errcode) | |||
186 | 186 | ||
187 | /* -- External frame unwinding -------------------------------------------- */ | 187 | /* -- External frame unwinding -------------------------------------------- */ |
188 | 188 | ||
189 | #if defined(__GNUC__) && !LJ_NO_UNWIND && !LJ_TARGET_WINDOWS | 189 | #if defined(__GNUC__) && !LJ_NO_UNWIND && !LJ_ABI_WIN |
190 | 190 | ||
191 | /* | 191 | /* |
192 | ** We have to use our own definitions instead of the mandatory (!) unwind.h, | 192 | ** We have to use our own definitions instead of the mandatory (!) unwind.h, |
@@ -352,7 +352,7 @@ LJ_FUNCA int lj_err_unwind_arm(int state, void *ucb, _Unwind_Context *ctx) | |||
352 | 352 | ||
353 | #endif | 353 | #endif |
354 | 354 | ||
355 | #elif LJ_TARGET_X64 && LJ_TARGET_WINDOWS | 355 | #elif LJ_TARGET_X64 && LJ_ABI_WIN |
356 | 356 | ||
357 | /* | 357 | /* |
358 | ** Someone in Redmond owes me several days of my life. A lot of this is | 358 | ** Someone in Redmond owes me several days of my life. A lot of this is |
@@ -417,7 +417,9 @@ LJ_FUNCA EXCEPTION_DISPOSITION lj_err_unwind_win64(EXCEPTION_RECORD *rec, | |||
417 | if (cf2) { /* We catch it, so start unwinding the upper frames. */ | 417 | if (cf2) { /* We catch it, so start unwinding the upper frames. */ |
418 | if (rec->ExceptionCode == LJ_MSVC_EXCODE || | 418 | if (rec->ExceptionCode == LJ_MSVC_EXCODE || |
419 | rec->ExceptionCode == LJ_GCC_EXCODE) { | 419 | rec->ExceptionCode == LJ_GCC_EXCODE) { |
420 | #if LJ_TARGET_WINDOWS | ||
420 | __DestructExceptionObject(rec, 1); | 421 | __DestructExceptionObject(rec, 1); |
422 | #endif | ||
421 | setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP)); | 423 | setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP)); |
422 | } else if (!LJ_EXCODE_CHECK(rec->ExceptionCode)) { | 424 | } else if (!LJ_EXCODE_CHECK(rec->ExceptionCode)) { |
423 | /* Don't catch access violations etc. */ | 425 | /* Don't catch access violations etc. */ |