1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fixed mac atomics compile problem.

This commit is contained in:
Julian Storer 2010-03-26 20:03:24 +00:00
parent 66643e85ac
commit db08236375
3 changed files with 23 additions and 19 deletions

View file

@ -86106,7 +86106,7 @@ public:
{
w = font.getStringWidth (t);
h = roundToInt (f.getHeight());
isNewLine = t.containsAnyOf ("\r\n");
isNewLine = t.containsChar ('\n') || t.containsChar ('\r');
}
Token (const Token& other) throw()

View file

@ -3113,12 +3113,12 @@ private:
inline void* Atomic::swapPointers (void* volatile* value1, void* value2)
{
void* currentVal = *value1;
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 && ! JUCE_64BIT
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 && ! JUCE_64BIT
while (! OSAtomicCompareAndSwap32 (reinterpret_cast <int32_t> (currentVal), reinterpret_cast <int32_t> (value2),
reinterpret_cast <volatile int32_t*> (value1))) { currentVal = *value1; }
#else
const_cast <int32_t*> (reinterpret_cast <volatile int32_t*> (value1)))) { currentVal = *value1; }
#else
while (! OSAtomicCompareAndSwapPtr (currentVal, value2, value1)) { currentVal = *value1; }
#endif
#endif
return currentVal;
}
@ -3134,11 +3134,13 @@ private:
inline void* Atomic::swapPointers (void* volatile* value1, void* value2)
{
#if __ia64__
return reinterpret_cast<void*> (_InterlockedExchange64 (reinterpret_cast<volatile __int64*> (value1), reinterpret_cast<__int64> (value2)));
#else
return reinterpret_cast<void*> (_InterlockedExchange (reinterpret_cast<volatile int*> (value1), reinterpret_cast<long> (value2)));
#endif
#if __ia64__
return reinterpret_cast<void*> (_InterlockedExchange64 (reinterpret_cast<volatile __int64*> (value1),
reinterpret_cast<__int64> (value2)));
#else
return reinterpret_cast<void*> (_InterlockedExchange (reinterpret_cast<volatile int*> (value1),
reinterpret_cast<long> (value2)));
#endif
}
#else

View file

@ -73,12 +73,12 @@ private:
inline void* Atomic::swapPointers (void* volatile* value1, void* value2)
{
void* currentVal = *value1;
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 && ! JUCE_64BIT
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 && ! JUCE_64BIT
while (! OSAtomicCompareAndSwap32 (reinterpret_cast <int32_t> (currentVal), reinterpret_cast <int32_t> (value2),
reinterpret_cast <volatile int32_t*> (value1))) { currentVal = *value1; }
#else
const_cast <int32_t*> (reinterpret_cast <volatile int32_t*> (value1)))) { currentVal = *value1; }
#else
while (! OSAtomicCompareAndSwapPtr (currentVal, value2, value1)) { currentVal = *value1; }
#endif
#endif
return currentVal;
}
@ -95,11 +95,13 @@ private:
inline void* Atomic::swapPointers (void* volatile* value1, void* value2)
{
#if __ia64__
return reinterpret_cast<void*> (_InterlockedExchange64 (reinterpret_cast<volatile __int64*> (value1), reinterpret_cast<__int64> (value2)));
#else
return reinterpret_cast<void*> (_InterlockedExchange (reinterpret_cast<volatile int*> (value1), reinterpret_cast<long> (value2)));
#endif
#if __ia64__
return reinterpret_cast<void*> (_InterlockedExchange64 (reinterpret_cast<volatile __int64*> (value1),
reinterpret_cast<__int64> (value2)));
#else
return reinterpret_cast<void*> (_InterlockedExchange (reinterpret_cast<volatile int*> (value1),
reinterpret_cast<long> (value2)));
#endif
}
#else