+
+/* Unlike MS and mingw.org, MinGW64 doesn't define gai_strerror as an
+ inline function in a system header file, and instead seems to
+ require to link against ws2_32.a. But we don't want to link with
+ -lws2_32, as that would make Emacs dependent on the respective DLL.
+ So MinGW64 is amply punished here by the following: */
+#undef HAVE_GAI_STRERROR
+#endif
+
+/* The following is needed for recovery from C stack overflows. */
+#include <setjmp.h>
+typedef jmp_buf sigjmp_buf;
+#ifdef MINGW_W64
+/* Evidently, MinGW64's longjmp crashes when invoked from an exception
+ handler, see https://sourceforge.net/p/mingw-w64/mailman/message/32421953/.
+ This seems to be an unsolved problem in the MinGW64 runtime. So we
+ use the GCC intrinsics instead. FIXME. */
+#define sigsetjmp(j,m) __builtin_setjmp(j)
+#else
+#define sigsetjmp(j,m) setjmp(j)