diff --git a/Common/GmshSocket.h b/Common/GmshSocket.h
index ee7671f8f624002746c9189ad3bc793b2e2f7fcb..7117caa2d5c5b7d6528780f0efdd47d5992d071f 100644
--- a/Common/GmshSocket.h
+++ b/Common/GmshSocket.h
@@ -363,7 +363,7 @@ class GmshServer : public GmshSocket{
 #if !defined(WIN32) || defined(__CYGWIN__)
       if(tmpsock < 0)
 #else
-      if(tmpsock == INVALID_SOCKET)
+	if(tmpsock == (int)INVALID_SOCKET)
 #endif
         throw "Couldn't create socket";
       // bind the socket to its name