Hi, now that __declspec(exports) is used, the autoconf build system needs to be adjusted to make it work. Currently, config.h is not included systematically, which causes for example dbus-errors.h to miss the decoration and thus its symbols are not exported. The first patch (0001) fixes that by following convention to include <config.h> before any other header file (including system header files!) in every .c file but never in any .h file. The second patch (0002) adds the missing -Ddbus_1_EXPORTS to the build flags for libdbus-1.dll. The third patch (0003) fixes the public header files, which currently rely on the internal symbol DBUS_WIN to dispatch between dllimport and dllexport decoration. That is not defined outside of dbus-windows, and thus should not occur in the public header files. The patch replaces it by the standard symbol _WIN32. An alternative approach (not shown here) would be to define DBUS_WIN in dbus-arch-deps.h. Thanks!
Created attachment 34236 [details] [review] Consistently include config.h in all C source fiels. Include <config.h> first in all .c files, but in no .h files.
Created attachment 34237 [details] [review] Define dbus_1_EXPORTS This defines dbus_1_EXPORTS where needed for autoconf based builds.
Created attachment 34238 [details] [review] Do not use DBUS_WIN in a public header file Use _WIN32 instead DBUS_WIN in public header file. Alternative would be extending dbus-arch-deps.h, probably by this (untested): #if @DBUS_WIN@ #define DBUS_WIN 1 #else #undef DBUS_WIN #endif
Hi Colin, do you see any problems with the first patch ? The other two does not make any problem as far as I can see.
patch 1 depends on the wince patch (..glue file). I can apply without the related fix, which should be added to the wince patch diff --git a/dbus/dbus-sysdeps-wince-glue.c b/dbus/dbus-sysdeps-wince-glue.c index 38b59c6..204e719 100644 --- a/dbus/dbus-sysdeps-wince-glue.c +++ b/dbus/dbus-sysdeps-wince-glue.c @@ -26,6 +26,7 @@ * */ +#include <config.h> #include "dbus-internals.h" #include "dbus-sysdeps.h" #include "dbus-sysdeps-win.h"
I tried building with cmake/msvc on windows, no other problems detected.
patches tested with cmake and msvc + mingw without any errors - applied
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.