[cairo-commit] 2 commits - src/cairo-atomic-private.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Apr 16 10:10:05 UTC 2023


 src/cairo-atomic-private.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 5e74744dff73214b18323c335da3497d506b69fe
Merge: 10747fe81 16074af6a
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun Apr 16 10:10:03 2023 +0000

    Merge branch 'issue-776' into 'master'
    
    win32: InterlockedCompareExchange uses LONG
    
    Closes #776
    
    See merge request cairo/cairo!472

commit 16074af6a18e708629306a47593ec4b7bd6fe27f
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Apr 12 20:30:57 2023 +0930

    win32: InterlockedCompareExchange uses LONG
    
    Fixes #776

diff --git a/src/cairo-atomic-private.h b/src/cairo-atomic-private.h
index 727f97c75..89556ef7f 100644
--- a/src/cairo-atomic-private.h
+++ b/src/cairo-atomic-private.h
@@ -304,16 +304,16 @@ _cairo_atomic_int_get (cairo_atomic_int_t *x)
 # define _cairo_atomic_int_get_relaxed(x) *(x)
 # define _cairo_atomic_int_set_relaxed(x, val) *(x) = (val)
 
-# define _cairo_atomic_int_inc(x) ((void) InterlockedIncrement (x))
-# define _cairo_atomic_int_dec(x) ((void) InterlockedDecrement (x))
-# define _cairo_atomic_int_dec_and_test(x) (InterlockedDecrement (x) == 0)
+# define _cairo_atomic_int_inc(x) ((void) InterlockedIncrement ((LONG*)x))
+# define _cairo_atomic_int_dec(x) ((void) InterlockedDecrement ((LONG*)x))
+# define _cairo_atomic_int_dec_and_test(x) (InterlockedDecrement ((LONG*)x) == 0)
 
 static cairo_always_inline cairo_bool_t
 _cairo_atomic_int_cmpxchg (cairo_atomic_int_t *x,
                            cairo_atomic_int_t oldv,
                            cairo_atomic_int_t newv)
 {
-    return InterlockedCompareExchange ((unsigned int*)x, (unsigned int)newv, (unsigned int)oldv) == oldv;
+    return InterlockedCompareExchange ((LONG*)x, (LONG)newv, (LONG)oldv) == oldv;
 }
 
 static cairo_always_inline void *


More information about the cairo-commit mailing list