mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix for atomics in OSX10.4, and popup menus on unusual monitor arrangements.
This commit is contained in:
parent
a23d875a44
commit
bc41a46dab
5 changed files with 20 additions and 6 deletions
|
|
@ -79,7 +79,7 @@
|
|||
#define NO_DUMMY_DECL
|
||||
|
||||
#if JUCE_BUILD_NATIVE
|
||||
#include "../src/../juce_amalgamated.h"
|
||||
#include "../juce_amalgamated.h" // FORCE_AMALGAMATOR_INCLUDE
|
||||
#endif
|
||||
|
||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200))
|
||||
|
|
|
|||
|
|
@ -613,7 +613,7 @@ public:
|
|||
#define NO_DUMMY_DECL
|
||||
|
||||
#if JUCE_BUILD_NATIVE
|
||||
#include "src/../juce_amalgamated.h"
|
||||
#include "juce_amalgamated.h" // FORCE_AMALGAMATOR_INCLUDE
|
||||
#endif
|
||||
|
||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200))
|
||||
|
|
@ -69029,6 +69029,9 @@ private:
|
|||
|
||||
int deltaY = wantedY - currentY;
|
||||
|
||||
windowPos.setSize (jmin (windowPos.getWidth(), mon.getWidth()),
|
||||
jmin (windowPos.getHeight(), mon.getHeight()));
|
||||
|
||||
const int newY = jlimit (mon.getY(),
|
||||
mon.getBottom() - windowPos.getHeight(),
|
||||
windowPos.getY() + deltaY);
|
||||
|
|
|
|||
|
|
@ -3157,10 +3157,14 @@ inline void Atomic::decrement (int32& variable) { OSAtomicDecrement32 ((int32_
|
|||
inline int32 Atomic::decrementAndReturn (int32& variable) { return OSAtomicDecrement32 ((int32_t*) &variable); }
|
||||
inline int32 Atomic::compareAndExchange (int32& destination, int32 newValue, int32 oldValue)
|
||||
{ return OSAtomicCompareAndSwap32Barrier (oldValue, newValue, (int32_t*) &destination); }
|
||||
inline void* Atomic::swapPointers (void* volatile* value1, void* volatile value2)
|
||||
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
|
||||
while (! OSAtomicCompareAndSwap32 ((int32_t) currentVal, (int32_t) value2, (int32_t*) value1)) { currentVal = *value1; }
|
||||
#else
|
||||
while (! OSAtomicCompareAndSwapPtr (currentVal, value2, value1)) { currentVal = *value1; }
|
||||
#endif
|
||||
return currentVal;
|
||||
}
|
||||
|
||||
|
|
@ -3172,7 +3176,7 @@ inline void Atomic::decrement (int32& variable) { __sync_add_and_fetch (&varia
|
|||
inline int32 Atomic::decrementAndReturn (int32& variable) { return __sync_add_and_fetch (&variable, -1); }
|
||||
inline int32 Atomic::compareAndExchange (int32& destination, int32 newValue, int32 oldValue)
|
||||
{ return __sync_val_compare_and_swap (&destination, oldValue, newValue); }
|
||||
inline void* Atomic::swapPointers (void* volatile* value1, void* volatile value2)
|
||||
inline void* Atomic::swapPointers (void* volatile* value1, void* value2)
|
||||
{
|
||||
void* currentVal = *value1;
|
||||
while (! __sync_bool_compare_and_swap (value1, currentVal, value2)) { currentVal = *value1; }
|
||||
|
|
|
|||
|
|
@ -65,10 +65,14 @@ inline void Atomic::decrement (int32& variable) { OSAtomicDecrem
|
|||
inline int32 Atomic::decrementAndReturn (int32& variable) { return OSAtomicDecrement32 ((int32_t*) &variable); }
|
||||
inline int32 Atomic::compareAndExchange (int32& destination, int32 newValue, int32 oldValue)
|
||||
{ return OSAtomicCompareAndSwap32Barrier (oldValue, newValue, (int32_t*) &destination); }
|
||||
inline void* Atomic::swapPointers (void* volatile* value1, void* volatile value2)
|
||||
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
|
||||
while (! OSAtomicCompareAndSwap32 ((int32_t) currentVal, (int32_t) value2, (int32_t*) value1)) { currentVal = *value1; }
|
||||
#else
|
||||
while (! OSAtomicCompareAndSwapPtr (currentVal, value2, value1)) { currentVal = *value1; }
|
||||
#endif
|
||||
return currentVal;
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +85,7 @@ inline void Atomic::decrement (int32& variable) { __sync_add_and
|
|||
inline int32 Atomic::decrementAndReturn (int32& variable) { return __sync_add_and_fetch (&variable, -1); }
|
||||
inline int32 Atomic::compareAndExchange (int32& destination, int32 newValue, int32 oldValue)
|
||||
{ return __sync_val_compare_and_swap (&destination, oldValue, newValue); }
|
||||
inline void* Atomic::swapPointers (void* volatile* value1, void* volatile value2)
|
||||
inline void* Atomic::swapPointers (void* volatile* value1, void* value2)
|
||||
{
|
||||
void* currentVal = *value1;
|
||||
while (! __sync_bool_compare_and_swap (value1, currentVal, value2)) { currentVal = *value1; }
|
||||
|
|
|
|||
|
|
@ -1002,6 +1002,9 @@ private:
|
|||
|
||||
int deltaY = wantedY - currentY;
|
||||
|
||||
windowPos.setSize (jmin (windowPos.getWidth(), mon.getWidth()),
|
||||
jmin (windowPos.getHeight(), mon.getHeight()));
|
||||
|
||||
const int newY = jlimit (mon.getY(),
|
||||
mon.getBottom() - windowPos.getHeight(),
|
||||
windowPos.getY() + deltaY);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue