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

Re: [xml] python bindings are not IN_LIBXML



Stéphane Bidoul said:
> Hi,
>
> 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?
>
> -sbi
>
> 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 ----
>
I'm afraid that was my fault for not looking more carefully into why
this warning occured - my apologies!  I've applied your patch and
will have it committed later in the day.  Thanks for the correction.

Bill



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