view src/dbus-1-fixes.patch @ 3108:acee522701c0

[MSVC] enable dbus compilation
author Michael Goffioul <michael.goffioul@gmail.com>
date Fri, 28 Jun 2013 21:14:15 -0400
parents 0c267ecd6ee6
children
line wrap: on
line source

This file is part of MXE.
See index.html for further information.

Contains ad hoc patches for cross building.

From d7bc1aff67132c09d154999c282e1b391bbe7a39 Mon Sep 17 00:00:00 2001
From: MXE
Date: Fri, 23 Sep 2011 16:24:46 +0200
Subject: [PATCH 1/1] add missing MemoryBarrier (MXE specific)

Windows API has this, but it's not in MinGW.
See http://lists-archives.org/mingw-users/15935-missing-definition-of-memorybarrier.html

diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index b492b09..082225f 100644
--- a/dbus/dbus-sysdeps-win.c
+++ b/dbus/dbus-sysdeps-win.c
@@ -55,6 +55,15 @@
 #include <ws2tcpip.h>
 #include <wincrypt.h>
 
+#ifdef __GNUC__
+__CRT_INLINE VOID MemoryBarrier(VOID)
+{
+  LONG Barrier = 0;
+  __asm__ __volatile__("xchgl %%eax,%0 "
+    :"=r" (Barrier));
+}
+#endif
+
 /* Declarations missing in mingw's headers */
 extern BOOL WINAPI ConvertStringSidToSidA (LPCSTR  StringSid, PSID *Sid);
 extern BOOL WINAPI ConvertSidToStringSidA (PSID Sid, LPSTR *StringSid);
-- 
1.7.6.3