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:42 +0100
committerJörg Frings-Fürst <debian@jff-webhsoting.net>2019-01-12 17:38:42 +0100
commit6ada0507368fa5980bbfbe747480b68c632d7c37 (patch)
tree7b7f82d9ac64641da59e9948883e1289ad7b7f38 /tool/uriparse.c
parenta08fa80b53e2228c96f6f49d0e5040348c57e97f (diff)
parent63b80068976fbc5460c284aef0e6560abcf13e68 (diff)
Update upstream source from tag 'upstream/0.9.1'
Update to upstream version '0.9.1' with Debian dir d61ac191808ad347e1c3732d262d9bd3dfe33000
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) {