Bug 47321 - Fix compilation with mingw-w64
Summary: Fix compilation with mingw-w64
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.4.x
Hardware: Other All
: medium normal
Assignee: Havoc Pennington
QA Contact: John (J5) Palmieri
URL:
Whiteboard: review-, minor changes
Keywords: patch
Depends on:
Blocks:
 
Reported: 2012-03-14 14:02 UTC by Andoni Morales Alastruey
Modified: 2012-03-27 07:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Fix compilation with mingw-w64 (1.92 KB, patch)
2012-03-14 14:02 UTC, Andoni Morales Alastruey
Details | Splinter Review
Fix compilation with mingw-w64 (1.97 KB, patch)
2012-03-26 07:15 UTC, Andoni Morales Alastruey
Details | Splinter Review

Description Andoni Morales Alastruey 2012-03-14 14:02:43 UTC
Created attachment 58448 [details] [review]
Fix compilation with mingw-w64

Avoid duplicated case values to fix compilation with mingw-w64
Comment 1 Simon McVittie 2012-03-19 05:11:00 UTC
Am I right in thinking that the reason for this patch is: historically, Unix only had EWHATEVER and Windows only had WSAEWHATEVER, but recent mingw-w64 defines EWHATEVER to be WSAEWHATEVER as well?

If that's what you're dealing with here, this change looks like a reasonable way to fix that, although I'd prefer it with "#elif defined(WSAEADDRINUSE)" to avoid the extra level of nesting.

Would you mind revising the patch to use #elif, and mention why this change is needed in the commit message?

(Some notes on good commit messages: <http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html>; a good example of a commit message in dbus.git: <http://cgit.freedesktop.org/dbus/dbus/commit/?id=a8423067ceac1af6176e14fbc334fe5b82431e3d>)
Comment 2 Andoni Morales Alastruey 2012-03-19 14:32:25 UTC
At least on the 2.x branch of mingw-w64, both ESOMETHING and WSASOMETHING are defined (I was also surprised to see that). I will first double check with mingw-w64's maintainers whether this is intended or a bug.
Comment 3 Andoni Morales Alastruey 2012-03-26 07:15:22 UTC
Created attachment 59068 [details] [review]
Fix compilation with mingw-w64

Fixed unneeded nesting and commit message.

Mingw maintainers that this double definition is correct from their side.
From mingw-w64:

ylatuya: hi, I have proposed the following patch for DBUS to fix the compilation with mingw-w64: https://bugs.freedesktop.org/show_bug.cgi?id=47321
ylatuya: it looks like ESOMETHING and WSASOMETHING are both defined in mingw-w64, is that correct?
jon_y: ylatuya: yes
Comment 4 Andoni Morales Alastruey 2012-03-26 07:16:25 UTC
(In reply to comment #3)

> Mingw maintainers that this double definition is correct from their side.

This should be read: Mingw maintainers confirm that
Comment 5 Simon McVittie 2012-03-27 03:51:05 UTC
Comment on attachment 59068 [details] [review]
Fix compilation with mingw-w64

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

Looks great, I'll merge it. Thanks!
Comment 6 Simon McVittie 2012-03-27 07:02:10 UTC
Fixed in 1.4.20, 1.5.12


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.