[libxml2] socklen_t is always int on Windows



commit 45b0ebdc8d1336092d8dd2e3c77a08fda4dd4e70
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Mon Oct 9 00:08:10 2017 +0200

    socklen_t is always int on Windows
    
    Define XML_SOCKLEN_T as `int` unconditionally in wsockcompat.h. Fixes
    compiler warnings and removes some duplicated code.

 include/wsockcompat.h |    6 ++----
 nanoftp.c             |    2 --
 nanohttp.c            |    2 --
 xmllint.c             |    2 --
 4 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/include/wsockcompat.h b/include/wsockcompat.h
index cd73208..0484ee3 100644
--- a/include/wsockcompat.h
+++ b/include/wsockcompat.h
@@ -27,10 +27,8 @@
 #endif
 #endif
 
-#if !defined SOCKLEN_T
-#define SOCKLEN_T int
-#endif
-
+#undef XML_SOCKLEN_T
+#define XML_SOCKLEN_T int
 
 #ifndef ECONNRESET
 #define ECONNRESET WSAECONNRESET
diff --git a/nanoftp.c b/nanoftp.c
index 5bc6555..9219f47 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -83,8 +83,6 @@
 #endif
 #include <wsockcompat.h>
 #include <winsock2.h>
-#undef XML_SOCKLEN_T
-#define XML_SOCKLEN_T unsigned int
 #endif
 
 /**
diff --git a/nanohttp.c b/nanohttp.c
index 8a2b408..667d2ac 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -80,8 +80,6 @@
 #endif
 #include <wsockcompat.h>
 #include <winsock2.h>
-#undef XML_SOCKLEN_T
-#define XML_SOCKLEN_T unsigned int
 #endif
 
 #include <libxml/globals.h>
diff --git a/xmllint.c b/xmllint.c
index c175730..7ab1fb8 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -31,8 +31,6 @@
 #define _WINSOCKAPI_
 #include <wsockcompat.h>
 #include <winsock2.h>
-#undef XML_SOCKLEN_T
-#define XML_SOCKLEN_T unsigned int
 #endif
 
 #ifdef HAVE_SYS_TIMEB_H


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