Bug 88964

Summary: CMake Windows compile error
Product: dbus Reporter: Ralf Habacker <ralf.habacker>
Component: coreAssignee: D-Bus Maintainers <dbus>
Status: RESOLVED FIXED QA Contact: D-Bus Maintainers <dbus>
Severity: normal    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: Windows (All)   
Whiteboard: review?
i915 platform: i915 features:
Attachments: Fix cmake compile errors
Fix unix cmake compile errors
bus_driver_check_caller_is_privileged: correct the DBUS_WIN case

Description Ralf Habacker 2015-02-04 12:20:50 UTC
With recent master branch cmake windows builds are broken. See https://build.opensuse.org/package/live_build_log/home:rhabacker:branches:windows:mingw:win32/mingw32-dbus-1-cmake/openSUSE_13.1/x86_64
Comment 1 Ralf Habacker 2015-02-04 12:24:10 UTC
Created attachment 113153 [details] [review]
Fix cmake compile errors
Comment 2 Ralf Habacker 2015-02-04 12:51:32 UTC
Created attachment 113155 [details] [review]
Fix unix cmake compile errors
Comment 3 Simon McVittie 2015-02-04 12:57:33 UTC
Comment on attachment 113153 [details] [review]
Fix cmake compile errors

Review of attachment 113153 [details] [review]:
-----------------------------------------------------------------

The bit with the libraries is fine.

::: bus/driver.c
@@ +134,4 @@
>      }
>  
>    return TRUE;
> +#elifdef DBUS_WIN

#elifdef is not standard C.

I should have written #elif defined(DBUS_WIN), which I believe is the standard C spelling for what I intended. Does that version work for you?
Comment 4 Simon McVittie 2015-02-04 13:00:36 UTC
Comment on attachment 113155 [details] [review]
Fix unix cmake compile errors

Review of attachment 113155 [details] [review]:
-----------------------------------------------------------------

The parts of this commit dealing with the DBUS_USER and DBUS_TEST_USER are fine.

I'd prefer the #ifdef bits to be one correct patch, rather than a patch for Windows that breaks Unix followed by a patch that de-breaks Unix.

Combining everything you've done on this bug into one patch would be fine; having one patch for the #ifdef, one patch for the new helper library and one patch for the DBUS_USER/DBUS_TEST_USER would also be fine. Please choose whichever you prefer.

::: bus/driver.c
@@ +134,5 @@
>      }
>  
>    return TRUE;
> +#else
> +#ifdef DBUS_WIN

I'd prefer #elif defined(DBUS_WIN), unless #elif doesn't work on your compiler for some reason - then we wouldn't need the extra #endif.
Comment 5 Simon McVittie 2015-02-04 15:15:47 UTC
(In reply to Simon McVittie from comment #3)
> The bit with the libraries is fine.

(In reply to Simon McVittie from comment #4)
> The parts of this commit dealing with the DBUS_USER and DBUS_TEST_USER are
> fine.

I applied them for 1.9.10.
Comment 6 Simon McVittie 2015-02-04 15:17:30 UTC
Created attachment 113160 [details] [review]
bus_driver_check_caller_is_privileged: correct the DBUS_WIN  case

---

Does this work for you? Sorry, my mingw environment isn't working right now.
Comment 7 Ralf Habacker 2015-02-04 17:58:02 UTC
(In reply to Simon McVittie from comment #3)
> Comment on attachment 113153 [details] [review] [review]

> I should have written #elif defined(DBUS_WIN), which I believe is the
> standard C spelling for what I intended. Does that version work for you?

yes will take that.
Comment 8 Ralf Habacker 2015-02-04 18:09:38 UTC
Comment on attachment 113160 [details] [review]
bus_driver_check_caller_is_privileged: correct the DBUS_WIN  case

Review of attachment 113160 [details] [review]:
-----------------------------------------------------------------

#elif defined(DBUS_WIN) is fine with MINGW
Comment 9 Ralf Habacker 2015-02-04 19:15:59 UTC
Comment on attachment 113160 [details] [review]
bus_driver_check_caller_is_privileged: correct the DBUS_WIN  case

committed to master
Comment 10 Simon McVittie 2015-02-04 19:30:20 UTC
Thanks. Fixed in git for 1.9.10 (and I'll be more careful about doing cmake builds in future).
Comment 11 Ralf Habacker 2015-02-04 20:55:24 UTC
(In reply to Simon McVittie from comment #10)
> Thanks. Fixed in git for 1.9.10 (and I'll be more careful about doing cmake
> builds in future).

To get a quick build check I have registered mingw32 dbus git master builds at https://build.opensuse.org/project/show/home:rhabacker:branches:windows:mingw:win32 for autotools and cmake. See packages 
- mingw32-dbus-1 (autotools using git master)
- mingw32-dbus-1-cmake (cmake using git master)

Registered users are able to trigger a git checkout refresh and rebuild.

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.