Skip to content

Commit f5c554d

Browse files
igorgatispfalcon
authored andcommitted
py: Added Cygwin support to py/nlrx86.S.
1 parent 593faf1 commit f5c554d

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

py/nlrx86.S

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
// the offset of nlr_top within mp_state_ctx_t
3636
#define NLR_TOP_OFFSET (2 * 4)
3737

38-
#ifdef _WIN32
38+
#if defined(_WIN32) || defined(__CYGWIN__)
3939
#define NLR_TOP (_mp_state_ctx + NLR_TOP_OFFSET)
4040
#else
4141
#define NLR_TOP (mp_state_ctx + NLR_TOP_OFFSET)
@@ -47,7 +47,7 @@
4747
/**************************************/
4848
// mp_uint_t nlr_push(4(%esp)=nlr_buf_t *nlr)
4949

50-
#ifdef _WIN32
50+
#if defined(_WIN32) || defined(__CYGWIN__)
5151
.globl _nlr_push
5252
.def _nlr_push; .scl 2; .type 32; .endef
5353
_nlr_push:
@@ -69,14 +69,14 @@ nlr_push:
6969
mov %edx, NLR_TOP # stor new nlr_buf (to make linked list)
7070
xor %eax, %eax # return 0, normal return
7171
ret # return
72-
#ifndef _WIN32
72+
#if !(defined(_WIN32) || defined(__CYGWIN__))
7373
.size nlr_push, .-nlr_push
7474
#endif
7575

7676
/**************************************/
7777
// void nlr_pop()
7878

79-
#ifdef _WIN32
79+
#if defined(_WIN32) || defined(__CYGWIN__)
8080
.globl _nlr_pop
8181
.def _nlr_pop; .scl 2; .type 32; .endef
8282
_nlr_pop:
@@ -89,14 +89,14 @@ nlr_pop:
8989
mov (%eax), %eax # load prev nlr_buf
9090
mov %eax, NLR_TOP # store nlr_top (to unlink list)
9191
ret # return
92-
#ifndef _WIN32
92+
#if !(defined(_WIN32) || defined(__CYGWIN__))
9393
.size nlr_pop, .-nlr_pop
9494
#endif
9595

9696
/**************************************/
9797
// void nlr_jump(4(%esp)=mp_uint_t val)
9898

99-
#ifdef _WIN32
99+
#if defined(_WIN32) || defined(__CYGWIN__)
100100
.globl _nlr_jump
101101
.def _nlr_jump; .scl 2; .type 32; .endef
102102
_nlr_jump:
@@ -107,7 +107,7 @@ nlr_jump:
107107
#endif
108108
mov NLR_TOP, %edx # load nlr_top
109109
test %edx, %edx # check for nlr_top being NULL
110-
#ifdef _WIN32
110+
#if defined(_WIN32) || defined(__CYGWIN__)
111111
je _nlr_jump_fail # fail if nlr_top is NULL
112112
#else
113113
je nlr_jump_fail # fail if nlr_top is NULL
@@ -126,7 +126,7 @@ nlr_jump:
126126
xor %eax, %eax # clear return register
127127
inc %al # increase to make 1, non-local return
128128
ret # return
129-
#ifndef _WIN32
129+
#if !(defined(_WIN32) || defined(__CYGWIN__))
130130
.size nlr_jump, .-nlr_jump
131131
#endif
132132

0 commit comments

Comments
 (0)