[Patch] MSVC fixes for dbus master

Thiago Macieira thiago at kde.org
Mon Feb 22 23:24:22 PST 2010


	Em Terça-feira 23. Fevereiro 2010, às 02.02.53, Romain Pokrzywka 
escreveu:
> Hi,
> 
> Please find attached a couple of patches for minor fixes on windows with
> the msvc compiler (VS2008).
> 
> - The first patch fixes compilation errors when the option
> DBUS_USE_OUTPUT_DEBUG_STRING is enabled 

Looks fine.

> - The second patch is a trivial
> warning fix, a missing return statement 

Same.

> - The third patch is a little more
> tricky: basically MSVC (as of VS2008) doesn't support exporting global
> variables from a DLL just by using the "extern" keyword, even if the
> variable is exported as DATA in the .def file. What you get then is a
> linker error when trying to access the variable from outside the DLL. In
> what was probably an attempt to work around those linker errors, the
> "DATA" keyword was removed for the variables actually accessed outside
> libdbus-1.dll. However, while this fixes the linker issue, what you're
> accessing in that case is not the variable but some stub which contains
> the actual variable address in memory (iow, pVar instead of *pVar), which
> is bound for erratic behavior and crashes. So the only way to access
> global variables properly is to use the standard dllexport/dllimport
> pattern.

Looks fine too.
-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100223/b96cad1a/attachment.pgp>


More information about the dbus mailing list