summaryrefslogtreecommitdiff
path: root/tool/uriparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'tool/uriparse.c')
-rw-r--r--tool/uriparse.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/tool/uriparse.c b/tool/uriparse.c
index e9c1218..fc8bbb5 100644
--- a/tool/uriparse.c
+++ b/tool/uriparse.c
@@ -36,12 +36,20 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
#include <uriparser/Uri.h>
-#include <arpa/inet.h>
-#include <netinet/in.h>
+
+#ifdef _WIN32
+# include <winsock2.h>
+# include <ws2tcpip.h>
+WINSOCK_API_LINKAGE const char WSAAPI inet_ntop(
+ int af, const void *src, char *dst, socklen_t size);
+#else
+# include <sys/socket.h>
+# include <arpa/inet.h>
+# include <netinet/in.h>
+#endif
#define RANGE(x) (int)((x).afterLast-(x).first), ((x).first)
@@ -76,7 +84,8 @@ int main(int argc, char *argv[]) {
: (state.errorCode == URI_ERROR_MALLOC)
? "not enough memory"
: "liburiparser bug (please report)",
- state.errorPos, state.errorPos - argv[i]);
+ state.errorPos,
+ (long unsigned int)(state.errorPos - argv[i]));
retval = EXIT_FAILURE;
} else {
if (uri.scheme.first) {