comparison src/msvc-libxml2-1.patch @ 3100:a684a0d16101

[MSVC] enable libxml2 compilation
author Michael Goffioul <michael.goffioul@gmail.com>
date Wed, 26 Jun 2013 19:06:40 -0400
parents
children
comparison
equal deleted inserted replaced
3099:034f830a5823 3100:a684a0d16101
1 diff -ur libxml2-2.9.0-orig/include/libxml/nanoftp.h libxml2-2.9.0/include/libxml/nanoftp.h
2 --- libxml2-2.9.0-orig/include/libxml/nanoftp.h 2012-09-10 23:52:46 -0400
3 +++ libxml2-2.9.0/include/libxml/nanoftp.h 2013-06-26 18:41:33 -0400
4 @@ -16,7 +16,7 @@
5 #ifdef LIBXML_FTP_ENABLED
6
7 /* Needed for portability to Windows 64 bits */
8 -#if defined(__MINGW32__) || defined(_WIN32_WCE)
9 +#if defined(__MINGW32__) || defined(_WIN32_WCE) || defined(_MSC_VER)
10 #include <winsock2.h>
11 #else
12 /**
13 diff -ur libxml2-2.9.0-orig/libxml-2.0.pc.in libxml2-2.9.0/libxml-2.0.pc.in
14 --- libxml2-2.9.0-orig/libxml-2.0.pc.in 2013-06-26 18:40:35 -0400
15 +++ libxml2-2.9.0/libxml-2.0.pc.in 2013-06-26 18:51:43 -0400
16 @@ -8,7 +8,6 @@
17 Version: @VERSION@
18 Description: libXML library version2.
19 Requires:
20 -Requires.private: liblzma
21 Libs: -L${libdir} -lxml2
22 Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@
23 Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@
24 diff -ur libxml2-2.9.0-orig/libxml.h libxml2-2.9.0/libxml.h
25 --- libxml2-2.9.0-orig/libxml.h 2012-09-10 23:52:46 -0400
26 +++ libxml2-2.9.0/libxml.h 2013-06-26 18:43:16 -0400
27 @@ -38,6 +38,10 @@
28 #include <libxml/xmlversion.h>
29 #endif
30
31 +#ifdef _MSC_VER
32 +#define snprintf _snprintf
33 +#endif
34 +
35 #if defined(__Lynx__)
36 #include <stdio.h> /* pull definition of size_t */
37 #include <varargs.h>
38 diff -ur libxml2-2.9.0-orig/nanoftp.c libxml2-2.9.0/nanoftp.c
39 --- libxml2-2.9.0-orig/nanoftp.c 2012-09-11 00:24:08 -0400
40 +++ libxml2-2.9.0/nanoftp.c 2013-06-26 18:41:15 -0400
41 @@ -77,7 +77,7 @@
42 #endif
43
44
45 -#if defined(__MINGW32__) || defined(_WIN32_WCE)
46 +#if defined(__MINGW32__) || defined(_WIN32_WCE) || defined(_MSC_VER)
47 #ifndef _WINSOCKAPI_
48 #define _WINSOCKAPI_
49 #endif
50 diff -ur libxml2-2.9.0-orig/nanohttp.c libxml2-2.9.0/nanohttp.c
51 --- libxml2-2.9.0-orig/nanohttp.c 2012-09-11 00:23:25 -0400
52 +++ libxml2-2.9.0/nanohttp.c 2013-06-26 18:41:03 -0400
53 @@ -74,7 +74,7 @@
54 #define XML_SOCKLEN_T unsigned int
55 #endif
56
57 -#if defined(__MINGW32__) || defined(_WIN32_WCE)
58 +#if defined(__MINGW32__) || defined(_WIN32_WCE) || defined(_MSC_VER)
59 #ifndef _WINSOCKAPI_
60 #define _WINSOCKAPI_
61 #endif
62 diff -ur libxml2-2.9.0-orig/testC14N.c libxml2-2.9.0/testC14N.c
63 --- libxml2-2.9.0-orig/testC14N.c 2012-09-11 00:24:08 -0400
64 +++ libxml2-2.9.0/testC14N.c 2013-06-26 18:46:07 -0400
65 @@ -12,7 +12,7 @@
66 #include <stdio.h>
67 #include <string.h>
68 #ifndef STDOUT_FILENO
69 -#ifdef HAVE_UNISTD_H
70 +#if defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
71 #include <unistd.h>
72 #else
73 #define STDOUT_FILENO fileno(stdout)