]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cookie: avoid the C1001 internal compiler error with MSVC 14
authorJon Wilkes <jon@pluckeye.net>
Tue, 27 Oct 2020 19:47:57 +0000 (12:47 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 18 Dec 2020 13:02:27 +0000 (14:02 +0100)
Fixes #6112
Closes #6135

lib/cookie.c

index e88678c2194bbd9208c95d2a664e64e6d39d2f96..09fd092ac3da250ddecaa8191083f563f8ec5ee1 100644 (file)
@@ -264,6 +264,11 @@ static const char *get_top_domain(const char * const domain, size_t *outlen)
   return first? first: domain;
 }
 
+/* Avoid C1001, an "internal error" with MSVC14 */
+#if defined(_MSC_VER) && (_MSC_VER == 1900)
+#pragma optimize("", off)
+#endif
+
 /*
  * A case-insensitive hash for the cookie domains.
  */
@@ -280,6 +285,10 @@ static size_t cookie_hash_domain(const char *domain, const size_t len)
   return (h % COOKIE_HASH_SIZE);
 }
 
+#if defined(_MSC_VER) && (_MSC_VER == 1900)
+#pragma optimize("", on)
+#endif
+
 /*
  * Hash this domain.
  */