bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] testsuite for poll(2)


From: Bruno Haible
Subject: Re: [PATCH] testsuite for poll(2)
Date: Sat, 13 Sep 2008 11:31:12 +0200
User-agent: KMail/1.5.4

Paolo Bonzini wrote:
> Ok, will do so (s/HAVE_IO_H/__MSVCRT__).

But __MSVCRT__ is specific to mingw: the MSVC compiler does not define it.
(See also http://predef.sourceforge.net/) Some people use wrapper scripts
that make MSVC usable for autoconf based projects (cccl, cc-msvc.sh or similar).
Better use the idiom that works with this compiler as well.

OK to commit this patch?

--- tests/test-poll.c.orig      2008-09-13 11:23:13.000000000 +0200
+++ tests/test-poll.c   2008-09-13 11:21:49.000000000 +0200
@@ -31,7 +31,11 @@
 #include <errno.h>
 #include "sockets.h"
 
-#ifdef __MSVCRT__
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# define WIN32_NATIVE
+#endif
+
+#ifdef WIN32_NATIVE
 #include <io.h>
 #define pipe(x) _pipe(x, 256, O_BINARY)
 #endif
@@ -123,7 +127,7 @@
 
   if (!blocking)
     {
-#ifdef __MSVCRT__
+#ifdef WIN32_NATIVE
       unsigned long iMode = 1;
       ioctlsocket (s, FIONBIO, (void *) &iMode);
  
@@ -241,7 +245,7 @@
 static void
 test_accept_first (void)
 {
-#ifndef __MSVCRT__
+#ifndef WIN32_NATIVE
   int s = open_server_socket ();
   struct sockaddr_in ia;
   socklen_t addrlen;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]