Re: [xml] Creating Win32 wrapper function for exported variables

You can export variables if you use a .def file for the .dll.

There's no need for wrapper functions.


----- Original Message -----
From: "Vakoc, Mark" <Mark_Vakoc jdedwards com>
To: <xml gnome org>
Sent: Wednesday, July 18, 2001 2:19 AM
Subject: [xml] Creating Win32 wrapper function for exported variables

In Win32 you can import only functions from a library (.DLL) and not
variables.  This causes problems if libxml2 is built as a dll, and a
attempts to use an exported variable.  It will compile/link, but will fail
at runtime.

I propose creating simple wrappers for global parsing variables.  A good
example program is xsltproc, which has a line

if (novalid == 0)
  xmlLoadExtDtdDefaultValue = 6;
  xmlLoadExtDtdDefaultValue = 0;

If xsltproc is linked against libxml2 as a .DLL (not as a .lib), this will
cause a segv.

I created a wrapper function in parserInternals so the code now looks like

if (novalid == 0)

Extremely simple, but saves us win32 programmers some troubles. (I also
a xmlGetLoadExtDtdDefaultValue wrapper).

What do you think?

xml mailing list
xml gnome org

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