>From 9b8811110e0f7746a29e3fe030d42d6591a7bc4b Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov@codeweavers.com>
Date: Sun, 18 Dec 2011 21:12:19 +0300
Subject: [PATCH 3/6] libxml2 is not used for writer

---
 dlls/msxml3/msxml_private.h |   42 +++++++++++++++++++++---------------------
 dlls/msxml3/mxwriter.c      |   13 -------------
 2 files changed, 21 insertions(+), 34 deletions(-)

diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h
index 141c08c..813584a 100644
--- a/dlls/msxml3/msxml_private.h
+++ b/dlls/msxml3/msxml_private.h
@@ -375,6 +375,27 @@ static inline BSTR bstr_from_xmlChar(const xmlChar *str)
     return ret;
 }
 
+static inline xmlChar *xmlchar_from_wcharn(const WCHAR *str, int nchars)
+{
+    xmlChar *xmlstr;
+    DWORD len = WideCharToMultiByte( CP_UTF8, 0, str, nchars, NULL, 0, NULL, NULL );
+
+    xmlstr = heap_alloc( len+1 );
+    if ( xmlstr )
+    {
+        WideCharToMultiByte( CP_UTF8, 0, str, nchars, (LPSTR) xmlstr, len+1, NULL, NULL );
+        xmlstr[len] = 0;
+    }
+    return xmlstr;
+}
+
+static inline xmlChar *xmlchar_from_wchar( const WCHAR *str )
+{
+    return xmlchar_from_wcharn(str, -1);
+}
+
+#endif
+
 static inline HRESULT return_bstr(const WCHAR *value, BSTR *p)
 {
     if(!p)
@@ -425,27 +446,6 @@ static inline HRESULT return_null_bstr(BSTR *p)
     return S_FALSE;
 }
 
-static inline xmlChar *xmlchar_from_wcharn(const WCHAR *str, int nchars)
-{
-    xmlChar *xmlstr;
-    DWORD len = WideCharToMultiByte( CP_UTF8, 0, str, nchars, NULL, 0, NULL, NULL );
-
-    xmlstr = heap_alloc( len+1 );
-    if ( xmlstr )
-    {
-        WideCharToMultiByte( CP_UTF8, 0, str, nchars, (LPSTR) xmlstr, len+1, NULL, NULL );
-        xmlstr[len] = 0;
-    }
-    return xmlstr;
-}
-
-static inline xmlChar *xmlchar_from_wchar( const WCHAR *str )
-{
-    return xmlchar_from_wcharn(str, -1);
-}
-
-#endif
-
 extern IXMLDOMParseError *create_parseError( LONG code, BSTR url, BSTR reason, BSTR srcText,
                                              LONG line, LONG linepos, LONG filepos ) DECLSPEC_HIDDEN;
 extern HRESULT DOMDocument_create(MSXML_VERSION, IUnknown*, void**) DECLSPEC_HIDDEN;
diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c
index be03877..0cca473 100644
--- a/dlls/msxml3/mxwriter.c
+++ b/dlls/msxml3/mxwriter.c
@@ -39,8 +39,6 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
 
-#ifdef HAVE_LIBXML2
-
 static const WCHAR utf16W[] = {'U','T','F','-','1','6',0};
 static const WCHAR emptyW[] = {0};
 
@@ -1144,14 +1142,3 @@ HRESULT MXWriter_create(MSXML_VERSION version, IUnknown *outer, void **ppObj)
 
     return S_OK;
 }
-
-#else
-
-HRESULT MXWriter_create(MSXML_VERSION version, IUnknown *outer, void **obj)
-{
-    MESSAGE("This program tried to use a MXXMLWriter object, but\n"
-            "libxml2 support was not present at compile time.\n");
-    return E_NOTIMPL;
-}
-
-#endif /* HAVE_LIBXML2 */
-- 
1.5.6.5


