diff --git a/tests/server/sws.c b/tests/server/sws.c
index 99f1880171996691fa18056e4a7ca0905277fb8b..accf5555bb444c820242274e88c1707390bfd1e3 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -183,13 +183,15 @@ static const char *doc404 = "HTTP/1.1 404 Not Found\r\n"
     "The requested URL was not found on this server.\n"
     "<P><HR><ADDRESS>" SWSVERSION "</ADDRESS>\n" "</BODY></HTML>\n";
 
-#if defined(SIGPIPE) && defined(HAVE_SIGNAL)
+#ifndef WIN32
+#  if defined(SIGPIPE) && defined(HAVE_SIGNAL)
 static volatile int sigpipe;  /* Why? It's not used */
 static void sigpipe_handler(int sig)
 {
   (void)sig; /* prevent warning */
   sigpipe = 1;
 }
+#  endif
 #endif
 
 static int ProcessRequest(struct httprequest *req)