[HarfBuzz] harfbuzz: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Mon Sep 10 09:06:37 UTC 2018
src/hb-atomic.hh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit d42f0e5809964136911cbbd845bc423a8dfd5e31
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 10 11:05:33 2018 +0200
[atomic] Fix pointer type passed to InterlockedExchangeAdd()
John Emmas reported on mailing list that build with MSVC is failing.
Not sure why bots don't catch it, but this should fix.
diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh
index d494c895..6e3672c1 100644
--- a/src/hb-atomic.hh
+++ b/src/hb-atomic.hh
@@ -98,7 +98,7 @@ static inline void _hb_memory_barrier (void)
{
#if !defined(MemoryBarrier)
/* MinGW has a convoluted history of supporting MemoryBarrier. */
- long dummy = 0;
+ LONG dummy = 0;
InterlockedExchange (&dummy, 1);
#else
MemoryBarrier ();
@@ -106,7 +106,8 @@ static inline void _hb_memory_barrier (void)
}
#define _hb_memory_barrier() _hb_memory_barrier ()
-#define hb_atomic_int_impl_add(AI, V) InterlockedExchangeAdd ((unsigned *) (AI), (V))
+#define hb_atomic_int_impl_add(AI, V) InterlockedExchangeAdd ((LONG *) (AI), (V))
+static_assert ((sizeof (LONG) == sizeof (int)), "");
#define hb_atomic_ptr_impl_cmpexch(P,O,N) (InterlockedCompareExchangePointer ((void **) (P), (void *) (N), (void *) (O)) == (void *) (O))
More information about the HarfBuzz
mailing list