From 7a6d7364a65953d79c2ada13e576220fb5a0658f Mon Sep 17 00:00:00 2001
From: Robert Bradshaw <robertwb@google.com>
Date: Mon, 18 Apr 2016 10:25:07 -0700
Subject: [PATCH] Work around MCVS else if stacking limit.

---
 Cython/Compiler/ModuleNode.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index 8ad49ecb9..2ac3bdc2e 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -2022,8 +2022,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
 
         old_error_label = code.new_error_label()
         code.putln("if (0);")  # so the first one can be "else if"
+        msvc_count = 0
         for name, entry in sorted(env.entries.items()):
             if entry.is_cglobal and entry.used:
+                msvc_count += 1
+                if msvc_count % 100 == 0:
+                    code.putln("#ifdef _MSC_VER")
+                    code.putln("if (0);  /* Workaround for MSVC C1061. */")
+                    code.putln("#endif")
                 code.putln('else if (__Pyx_StrEq(name, "%s")) {' % name)
                 if entry.type.is_pyobject:
                     if entry.type.is_extension_type or entry.type.is_builtin_type:
-- 
2.30.9