[libxml2] Fix windows unicode build



commit 5a82e48edcb95d79345cd073bcdbbf0f211ebf63
Author: Patrick Gansterer <paroga paroga com>
Date:   Mon Aug 13 17:39:06 2012 +0800

    Fix windows unicode build
    
    For https://bugzilla.gnome.org/show_bug.cgi?id=638650
    After much discussions in the list:
    https://mail.gnome.org/archives/xml/2012-May/msg00062.html
    
    The simplest at this point is to fallback to only officially
    supporting ASCII names in those APIs, document it and use
    the "A" entry points on Windows.

 xmlmodule.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/xmlmodule.c b/xmlmodule.c
index 9ffd610..a59a1ec 100644
--- a/xmlmodule.c
+++ b/xmlmodule.c
@@ -61,6 +61,10 @@ xmlModuleErrMemory(xmlModulePtr module, const char *extra)
  * @options: a set of xmlModuleOption
  *
  * Opens a module/shared library given its name or path
+ * NOTE: that due to portability issues, behaviour can only be
+ * guaranteed with @name using ASCII. We canot guarantee that
+ * an UTF-8 string would work, which is why name is a const char *
+ * and not a const xmlChar * .
  * TODO: options are not yet implemented.
  *
  * Returns a handle for the module or NULL in case of error
@@ -99,6 +103,10 @@ xmlModuleOpen(const char *name, int options ATTRIBUTE_UNUSED)
  * @symbol: the resulting symbol address
  *
  * Lookup for a symbol address in the given module
+ * NOTE: that due to portability issues, behaviour can only be
+ * guaranteed with @name using ASCII. We canot guarantee that
+ * an UTF-8 string would work, which is why name is a const char *
+ * and not a const xmlChar * .
  *
  * Returns 0 if the symbol was found, or -1 in case of error
  */
@@ -300,7 +308,7 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
 static void *
 xmlModulePlatformOpen(const char *name)
 {
-    return LoadLibrary(name);
+    return LoadLibraryA(name);
 }
 
 /*
@@ -326,7 +334,7 @@ xmlModulePlatformClose(void *handle)
 static int
 xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
 {
-    *symbol = GetProcAddress(handle, name);
+    *symbol = GetProcAddressA(handle, name);
     return (NULL == *symbol) ? -1 : 0;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]