-# ifndef EAI_BADFLAGS
-# define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
-# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
-# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
-# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
-# define EAI_NODATA -5 /* No address associated with NAME. */
-# define EAI_FAMILY -6 /* `ai_family' not supported. */
-# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
-# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
-# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
-# define EAI_MEMORY -10 /* Memory allocation failure. */
-# define EAI_SYSTEM -11 /* System error returned in `errno'. */
-# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
-# endif
+#ifndef EAI_BADFLAGS
+# define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
+# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
+# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
+# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
+# define EAI_NODATA -5 /* No address associated with NAME. */
+# define EAI_FAMILY -6 /* `ai_family' not supported. */
+# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
+# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
+# define EAI_MEMORY -10 /* Memory allocation failure. */
+#endif
+#ifndef EAI_OVERFLOW
+/* Not defined on mingw32. */
+# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
+#endif
+#ifndef EAI_ADDRFAMILY
+/* Not defined on mingw32. */
+# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
+#endif
+#ifndef EAI_SYSTEM
+/* Not defined on mingw32. */
+# define EAI_SYSTEM -11 /* System error returned in `errno'. */
+#endif