diff --git a/src/hb-atomic-private.hh b/src/hb-atomic-private.hh index 7047e216cffe892cd7c20417e832471a3f604062..9cc3bc5587c89fe6480b5adea8aa54d5c51bace7 100644 --- a/src/hb-atomic-private.hh +++ b/src/hb-atomic-private.hh @@ -47,6 +47,14 @@ #define WIN32_LEAN_AND_MEAN #include +#if defined(__MINGW32__) && !defined(MemoryBarrier) +static inline void _HBMemoryBarrier (void) { + long dummy = 0; + InterlockedExchange (&dummy, 1); +} +# define MemoryBarrier _HBMemoryBarrier +#endif + typedef LONG hb_atomic_int_t; #define hb_atomic_int_add(AI, V) InterlockedExchangeAdd (&(AI), (V))