32 bit OSX plugins not compiling with latest tip - OSAtomic issue?


#1

Hi all,

 

I have been updating my plugins for AAX, and am therefore trying to keep up to date with the latest Juce tip. AAX and AU64 are compiling fine, but my 32 bit plugins (AU, VST, RTAS) are now throwing me several hundred errors when I generate Xcode projects from Introjucer and compile them. The errors are all along the lines of

juce_Atomic.h:262: error: there are no arguments to 'OSAtomicAdd64Barrier' that depend on a template parameter, so a declaration of 'OSAtomicAdd64Barrier' must be available

juce_Atomic.h:324: error: there are no arguments to 'OSAtomicDecrement64Barrier' that depend on a template parameter, so a declaration of 'OSAtomicDecrement64Barrier' must be available

juce_Atomic.h:338: error: there are no arguments to 'OSAtomicCompareAndSwap64Barrier' that depend on a template parameter, so a declaration of 'OSAtomicCompareAndSwap64Barrier' must be available

juce_Atomic.h:310: error: 'OSAtomicIncrement64Barrier' was not declared in this scope

There are a few hundred more errors like this.

All of these projects were working a week or two ago. The only changes to one of the plugins (ValhallaRoom) was to simply regenerate the project from Introjucer, to incorporate any new #include statements and the like. So this is clearly due to some change in the Juce code.

Searching the forums for these errors, I found this thread:

http://www.juce.com/forum/topic/arm64-assertions

which suggests that the declarations for these functions have been removed. Could this be the cause of the errors I am running into? If so, could these be, y'know, RE-declared, so I can continue to support 32-bit DAWs on OSX?


Thanks,


Sean Costello

 

 

 


#2

I just tried adding this code back into juce_Atomic.h, and things are compiling without error for me now:

 

#if JUCE_PPC || JUCE_IOS
// None of these atomics are available for PPC or for iOS 3.1 or earlier!!
template <typename Type> static Type OSAtomicAdd64Barrier (Type b, JUCE_MAC_ATOMICS_VOLATILE Type* a) noexcept  { jassertfalse; return *a += b; }
template <typename Type> static Type OSAtomicIncrement64Barrier (JUCE_MAC_ATOMICS_VOLATILE Type* a) noexcept    { jassertfalse; return ++*a; }
template <typename Type> static Type OSAtomicDecrement64Barrier (JUCE_MAC_ATOMICS_VOLATILE Type* a) noexcept    { jassertfalse; return --*a; }
template <typename Type> static bool OSAtomicCompareAndSwap64Barrier (Type old, Type newValue, JUCE_MAC_ATOMICS_VOLATILE Type* value) noexcept
{ jassertfalse; if (old == *value) { *value = newValue; return true; } return false; }
#define JUCE_64BIT_ATOMICS_UNAVAILABLE 1
#endif

Jules, could you please add this back into juce_Atomic.h? Removing the II JUCE_IOS condition allows for 32-bit OSX plugins to compile fine, and will probably fix the earlier 64-bit iOS issue referred to in the ARM64 assertations thread.

Thanks,


Sean Costello


#3

..so do you mean you're still doing PPC builds?

i.e. if I added this:


#if JUCE_PPC // None of these atomics are available for PPC!!
template <typename Type> static Type OSAtomicAdd64Barrier (Type b,

..then that'd work?

(I've been kind of assuming lately that nobody's still targeting PPC, which is why I didn't bother leaving that case in there)


#4

I do still target PPC. A few other plugin folks do as well. Obviously, this won't last forever, but for the time being, if you left in the PPC stuff, this would be great!

 

Thanks,


Sean Costello

 

P.S. The bugs were happening when selecting the Universal Binary (32/64 bit build) option in the Introjucer as well, not just the 32 bit Universal BInary.


#5

Gotcha. Have put that back now, thanks!