Skip to content

Commit

Permalink
socklen_t is always int on Windows
Browse files Browse the repository at this point in the history
Define XML_SOCKLEN_T as `int` unconditionally in wsockcompat.h. Fixes
compiler warnings and removes some duplicated code.
  • Loading branch information
nwellnhof committed Oct 9, 2017
1 parent 5b2324b commit 45b0ebd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
6 changes: 2 additions & 4 deletions include/wsockcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions nanoftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@
#endif
#include <wsockcompat.h>
#include <winsock2.h>
#undef XML_SOCKLEN_T
#define XML_SOCKLEN_T unsigned int
#endif

/**
Expand Down
2 changes: 0 additions & 2 deletions nanohttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 0 additions & 2 deletions xmllint.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 45b0ebd

Please sign in to comment.