beta-0.89.2
[luatex.git] / source / libs / luajit / LuaJIT-PATCHES / patch-07-x86_64-cygwin
blobb3bdead9dd6c958fcd7945ba4ee66d38d3118985
1 diff -ur LuaJIT-2.1.0-beta1.orig/src/lj_alloc.c LuaJIT-2.1.0-beta1/src/lj_alloc.c
2 --- LuaJIT-2.1.0-beta1.orig/src/lj_alloc.c      2015-08-25 23:35:00.000000000 +0200
3 +++ LuaJIT-2.1.0-beta1/src/lj_alloc.c   2015-09-27 19:05:37.000000000 +0200
4 @@ -196,7 +196,7 @@
5    return ptr;
6  }
7  
8 -#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__)
9 +#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__) || defined(__CYGWIN__)
11  /* OSX and FreeBSD mmap() use a naive first-fit linear search.
12  ** That's perfect for us. Except that -pagezero_size must be set for OSX,
13 diff -ur LuaJIT-2.1.0-beta1.orig/src/lj_arch.h LuaJIT-2.1.0-beta1/src/lj_arch.h
14 --- LuaJIT-2.1.0-beta1.orig/src/lj_arch.h       2015-09-04 08:58:07.000000000 +0200
15 +++ LuaJIT-2.1.0-beta1/src/lj_arch.h    2015-09-27 19:05:37.000000000 +0200
16 @@ -155,7 +155,11 @@
17  #define LJ_ARCH_NAME           "x64"
18  #define LJ_ARCH_BITS           64
19  #define LJ_ARCH_ENDIAN         LUAJIT_LE
20 -#define LJ_ABI_WIN             LJ_TARGET_WINDOWS
21 +#if LJ_TARGET_WINDOWS || __CYGWIN__
22 +#define LJ_ABI_WIN             1
23 +#else
24 +#define LJ_ABI_WIN             0
25 +#endif
26  #define LJ_TARGET_X64          1
27  #define LJ_TARGET_X86ORX64     1
28  #define LJ_TARGET_EHRETREG     0
29 diff -ur LuaJIT-2.1.0-beta1.orig/src/lj_err.c LuaJIT-2.1.0-beta1/src/lj_err.c
30 --- LuaJIT-2.1.0-beta1.orig/src/lj_err.c        2015-08-25 23:35:00.000000000 +0200
31 +++ LuaJIT-2.1.0-beta1/src/lj_err.c     2015-09-27 19:05:37.000000000 +0200
32 @@ -183,7 +183,7 @@
34  /* -- External frame unwinding -------------------------------------------- */
36 -#if defined(__GNUC__) && !LJ_NO_UNWIND && !LJ_TARGET_WINDOWS
37 +#if defined(__GNUC__) && !LJ_NO_UNWIND && !LJ_ABI_WIN
39  /*
40  ** We have to use our own definitions instead of the mandatory (!) unwind.h,
41 @@ -349,7 +349,7 @@
43  #endif
45 -#elif LJ_TARGET_X64 && LJ_TARGET_WINDOWS
46 +#elif LJ_TARGET_X64 && LJ_ABI_WIN
48  /*
49  ** Someone in Redmond owes me several days of my life. A lot of this is
50 @@ -414,7 +414,9 @@
51      if (cf2) {  /* We catch it, so start unwinding the upper frames. */
52        if (rec->ExceptionCode == LJ_MSVC_EXCODE ||
53           rec->ExceptionCode == LJ_GCC_EXCODE) {
54 +#if LJ_TARGET_WINDOWS
55         __DestructExceptionObject(rec, 1);
56 +#endif
57         setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP));
58        } else if (!LJ_EXCODE_CHECK(rec->ExceptionCode)) {
59         /* Don't catch access violations etc. */