]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows: locate CMSG definitions in Winsock2.h when present
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 9 Sep 2013 01:51:53 +0000 (19:51 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 9 Sep 2013 01:51:53 +0000 (19:51 -0600)
Windows defines the CMSG macros in Winsock2.h sometimes. This allows the
definitions there to be used when present and avoids compiler errors
about double definitions.

  This is an iCelero project.

compat/cmsg.h

index 17d63be04a5801ccef7e993bc16b40e2c8e9987f..dc340e3703ea4627ff39ee0993d4159a013572a4 100644 (file)
@@ -9,6 +9,12 @@
 #include <sys/socket.h>
 #endif
 
+// WinSock2.h defines these for Windows
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#define CMSG_H_ // prevent re-definition
+#endif
+
 #ifndef CMSG_H_
 #define CMSG_H_