summaryrefslogtreecommitdiff
path: root/tool/uriparse.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhsoting.net>2019-01-12 17:38:40 +0100
committerJörg Frings-Fürst <debian@jff-webhsoting.net>2019-01-12 17:38:40 +0100
commit63b80068976fbc5460c284aef0e6560abcf13e68 (patch)
tree39c607425a3eea7b8f668e0120f6217857f71b14 /tool/uriparse.c
parent37162209a3da8812203022de6b81e4f05015043a (diff)
New upstream version 0.9.1upstream/0.9.1
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) {