summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhsoting.net>2019-01-13 12:37:00 +0100
committerJörg Frings-Fürst <debian@jff-webhsoting.net>2019-01-13 12:37:00 +0100
commitd289e0569e0317ffd228d8d0bf9f4a7a7a4fc41c (patch)
treebff28a21e5e235d32cd14177b0b1b93935bbaeb5 /tool
parent4525c4951ed4d49ceb65525cea14b9aa35f1d3fc (diff)
parenta567bbfee78959e9c35f0722328f22d24ef39d2b (diff)
Merge branch 'release/debian/0.9.1-1'debian/0.9.1-1
Diffstat (limited to 'tool')
-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) {