]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
'in6addr_any' must be placed in .c-file. Added 'REAL_WIN32' for
authorGisle Vanem <gvanem@broadpark.no>
Wed, 13 Sep 2006 13:41:53 +0000 (13:41 +0000)
committerGisle Vanem <gvanem@broadpark.no>
Wed, 13 Sep 2006 13:41:53 +0000 (13:41 +0000)
all Win32 targets except CygWin. Cleanup.

tests/server/util.c
tests/server/util.h

index c8faebbb5daab87d8c0d7f4b98bcc7ac3690d39e..724cb851747bc8cde21da644656595ff73b06d5f 100644 (file)
 #include "getpart.h"
 #include "util.h"
 
+#if defined(ENABLE_IPV6) && defined(__MINGW32__)
+const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }};
+#endif
+
 /*
  * ourerrno() returns the errno (or equivalent) on this platform to
  * hide platform specific for the function that calls this.
@@ -97,7 +101,7 @@ void logmsg(const char *msg, ...)
   }
 }
 
-#if defined(WIN32) && !defined(__CYGWIN__)
+#if defined(REAL_WIN32)
 /* use instead of perror() on generic windows */
 void win32_perror (const char *msg)
 {
@@ -111,9 +115,7 @@ void win32_perror (const char *msg)
      fprintf(stderr, "%s: ", msg);
   fprintf(stderr, "%s\n", buf);
 }
-#endif
 
-#if defined(WIN32) && !defined(__CYGWIN__)
 void win32_init(void)
 {
   WORD wVersionRequested;
@@ -143,7 +145,7 @@ void win32_cleanup(void)
 {
   WSACleanup();
 }
-#endif
+#endif  /* REAL_WIN32 */
 
 /* set by the main code to point to where the test dir is */
 const char *path=".";
@@ -154,4 +156,3 @@ char *test2file(long testno)
   snprintf(filename, sizeof(filename), TEST_DATA_PATH, path, testno);
   return filename;
 }
-
index de33462cfb3ff094cebdb8af6e925b0bf967d186..30395fc4cc152d2ac04bef28ca50f897e3428f7e 100644 (file)
@@ -40,6 +40,8 @@ extern const char *path;
 
 #if defined(WIN32) && !defined(__CYGWIN__)
 #include <process.h>
+#include <fcntl.h>
+#define REAL_WIN32
 
 #define sleep(sec)   Sleep ((sec)*1000)
 
@@ -49,20 +51,15 @@ extern const char *path;
 #define ENOTSOCK     WSAENOTSOCK
 #define ECONNREFUSED WSAECONNREFUSED
 
-#if defined(ENABLE_IPV6) && defined(__MINGW32__)
-const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }};
-#endif
-#endif
-
-#endif
-
-#if defined(WIN32) && !defined(__CYGWIN__)
 #undef perror
 #define perror(m) win32_perror(m)
-#endif
+void win32_perror (const char *msg);
 
 void win32_init(void);
 void win32_cleanup(void);
+#endif  /* WIN32 && !__CYGWIN__ */
 
 /* returns the path name to the test case file */
 char *test2file(long testno);
+
+#endif  /* __SERVER_UTIL_H */