Skip to content

Commit eab5d29

Browse files
committed
Merge commit '6a93b596c5c3af31b843d63013a7985ffeea354d'
* commit '6a93b596c5c3af31b843d63013a7985ffeea354d': compat/atomics: add typecasts in atomic_compare_exchange_strong() Merged-by: James Almer <[email protected]>
2 parents 657c072 + 6a93b59 commit eab5d29

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compat/atomics/suncc/stdatomic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static inline int atomic_compare_exchange_strong(intptr_t *object, intptr_t *exp
108108
intptr_t desired)
109109
{
110110
intptr_t old = *expected;
111-
*expected = atomic_cas_ptr(object, old, desired);
111+
*expected = (intptr_t)atomic_cas_ptr(object, (void *)old, (void *)desired);
112112
return *expected == old;
113113
}
114114

compat/atomics/win32/stdatomic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ static inline int atomic_compare_exchange_strong(intptr_t *object, intptr_t *exp
105105
intptr_t desired)
106106
{
107107
intptr_t old = *expected;
108-
*expected = InterlockedCompareExchangePointer(object, desired, old);
108+
*expected = (intptr_t)InterlockedCompareExchangePointer(
109+
(PVOID *)object, (PVOID)desired, (PVOID)old);
109110
return *expected == old;
110111
}
111112

0 commit comments

Comments
 (0)