diff --git a/ports/windows/Makefile b/ports/windows/Makefile
index b6433300fe2be96251a1ebdf40e0752b4ad4cc15..725cb686e5e9b8caa6812539ac28b0dff9382dc5 100644
--- a/ports/windows/Makefile
+++ b/ports/windows/Makefile
@@ -50,10 +50,6 @@ CFLAGS_MOD += -DMICROPY_USE_READLINE=2
 LDFLAGS_MOD += -lreadline
 endif
 
-ifeq ($(CROSS_COMPILE),x86_64-w64-mingw32-)
-CFLAGS_MOD += -DMICROPY_NLR_SETJMP=1
-endif
-
 LIB += -lws2_32
 
 # List of sources for qstr extraction
diff --git a/py/nlr.c b/py/nlr.c
index 52d56afb8a1239930136b8500b8a75cdca86928d..7114d49978251d244bc323c59b4e7e0cf7298f3c 100644
--- a/py/nlr.c
+++ b/py/nlr.c
@@ -28,7 +28,7 @@
 
 #if !MICROPY_NLR_SETJMP
 // When not using setjmp, nlr_push_tail is called from inline asm so needs special c
-#if MICROPY_NLR_X86 && (defined(_WIN32) || defined(__CYGWIN__))
+#if MICROPY_NLR_X86 && MICROPY_NLR_OS_WINDOWS
 // On these 32-bit platforms make sure nlr_push_tail doesn't have a leading undersco
 unsigned int nlr_push_tail(nlr_buf_t *nlr) asm("nlr_push_tail");
 #else
diff --git a/py/nlr.h b/py/nlr.h
index e4dfa689633960db8df3a2ebab0a2256f3127ed1..90595a12d37dc0f578e172f4b51a092f7af3d969 100644
--- a/py/nlr.h
+++ b/py/nlr.h
@@ -36,13 +36,19 @@
 
 // If MICROPY_NLR_SETJMP is not enabled then auto-detect the machine arch
 #if !MICROPY_NLR_SETJMP
+// A lot of nlr-related things need different treatment on Windows
+#if defined(_WIN32) || defined(__CYGWIN__)
+#define MICROPY_NLR_OS_WINDOWS 1
+#else
+#define MICROPY_NLR_OS_WINDOWS 0
+#endif
 #if defined(__i386__)
     #define MICROPY_NLR_X86 (1)
     #define MICROPY_NLR_NUM_REGS (6)
 #elif defined(__x86_64__)
     #define MICROPY_NLR_X64 (1)
-    #if defined(__CYGWIN__)
-        #define MICROPY_NLR_NUM_REGS (12)
+    #if MICROPY_NLR_OS_WINDOWS
+        #define MICROPY_NLR_NUM_REGS (10)
     #else
         #define MICROPY_NLR_NUM_REGS (8)
     #endif
diff --git a/py/nlrx64.c b/py/nlrx64.c
index 663a457b70a4412c71541e0027570aca7de3a50c..a3a1cf341b9168f0f818ed8c8f6bb6ce14f0939b 100644
--- a/py/nlrx64.c
+++ b/py/nlrx64.c
@@ -33,18 +33,12 @@
 // x86-64 callee-save registers are:
 //  rbx, rbp, rsp, r12, r13, r14, r15
 
-#if defined(_WIN32) || defined(__CYGWIN__)
-#define NLR_OS_WINDOWS 1
-#else
-#define NLR_OS_WINDOWS 0
-#endif
-
 __attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr);
 
 unsigned int nlr_push(nlr_buf_t *nlr) {
     (void)nlr;
 
-    #if NLR_OS_WINDOWS
+    #if MICROPY_NLR_OS_WINDOWS
 
     __asm volatile (
     "movq   (%rsp), %rax        \n" // load return %rip
@@ -93,7 +87,7 @@ NORETURN void nlr_jump(void *val) {
 
     __asm volatile (
     "movq   %0, %%rcx           \n" // %rcx points to nlr_buf
-    #if NLR_OS_WINDOWS
+    #if MICROPY_NLR_OS_WINDOWS
     "movq   88(%%rcx), %%rsi    \n" // load saved %rsi
     "movq   80(%%rcx), %%rdi    \n" // load saved %rdr
     #endif
diff --git a/py/nlrx86.c b/py/nlrx86.c
index 9490c4f42cb8c769eee3b89526051e1ef0e80bfa..23882cc307ba5ecc88c209881d64289a81cea4ef 100644
--- a/py/nlrx86.c
+++ b/py/nlrx86.c
@@ -33,13 +33,7 @@
 // For reference, x86 callee save regs are:
 //  ebx, esi, edi, ebp, esp, eip
 
-#if defined(_WIN32) || defined(__CYGWIN__)
-#define NLR_OS_WINDOWS 1
-#else
-#define NLR_OS_WINDOWS 0
-#endif
-
-#if NLR_OS_WINDOWS
+#if MICROPY_NLR_OS_WINDOWS
 unsigned int nlr_push_tail(nlr_buf_t *nlr) asm("nlr_push_tail");
 #else
 __attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr);