[xml] python bindings are not IN_LIBXML


I noticed that python/generator.py now generates
#define IN_LIBXML. This causes mysterious
crashes in the windows version of the bindings,
because the linker does not bind to the correct
entry point for xmlFree...

The python binding cannot be considered as
beeing "IN_LIBXML", because, strictly speaking,
it's a client of libxml (a good client,
but a client nevertheless).

The CVS comment mentions the change was made
to silence a warning. I suppose it's about 
xmlErrMemory that's undefined. IMHO, the correct
way to suppress that warning is
to adapt generator.py in order 
to skip xmlErrMemory.

The proposed patch below fixes this.

On a related note, since xmlErrMemory 
is an internal libxml function, maybe the 
XMLPUBFUN modifier could be removed
so the function would not get exported?


Index: generator.py
RCS file: /cvs/gnome/gnome-xml/python/generator.py,v
retrieving revision 1.47
diff -c -r1.47 generator.py
*** generator.py        4 Dec 2003 12:31:48 -0000       1.47
--- generator.py        30 Dec 2003 20:52:08 -0000
*** 325,330 ****
--- 326,333 ----
          return 1
      if name == "xmlOutputBufferFlush": # handled by by the superclass
          return 1
+     if name == "xmlErrMemory":
+         return 1
      return 0

  def print_function_wrapper(name, output, export, include):
*** 574,580 ****
      wrapper.write("/* Generated */\n\n")
      wrapper.write("#include <Python.h>\n")
  #    wrapper.write("#include \"config.h\"\n")
-     wrapper.write("#define IN_LIBXML\n")
      wrapper.write("#include <libxml/xmlversion.h>\n")
      wrapper.write("#include <libxml/tree.h>\n")
      wrapper.write("#include <libxml/xmlschemastypes.h>\n")
--- 577,582 ----

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