Skip to content

Commit 45b0ebd

Browse files
committed
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.
1 parent 5b2324b commit 45b0ebd

4 files changed

Lines changed: 2 additions & 10 deletions

File tree

include/wsockcompat.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@
2727
#endif
2828
#endif
2929

30-
#if !defined SOCKLEN_T
31-
#define SOCKLEN_T int
32-
#endif
33-
30+
#undef XML_SOCKLEN_T
31+
#define XML_SOCKLEN_T int
3432

3533
#ifndef ECONNRESET
3634
#define ECONNRESET WSAECONNRESET

nanoftp.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@
8383
#endif
8484
#include <wsockcompat.h>
8585
#include <winsock2.h>
86-
#undef XML_SOCKLEN_T
87-
#define XML_SOCKLEN_T unsigned int
8886
#endif
8987

9088
/**

nanohttp.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@
8080
#endif
8181
#include <wsockcompat.h>
8282
#include <winsock2.h>
83-
#undef XML_SOCKLEN_T
84-
#define XML_SOCKLEN_T unsigned int
8583
#endif
8684

8785
#include <libxml/globals.h>

xmllint.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#define _WINSOCKAPI_
3232
#include <wsockcompat.h>
3333
#include <winsock2.h>
34-
#undef XML_SOCKLEN_T
35-
#define XML_SOCKLEN_T unsigned int
3634
#endif
3735

3836
#ifdef HAVE_SYS_TIMEB_H

0 commit comments

Comments
 (0)