Is there any check to see if a plugin is run under Rosetta 2?

Hi there,

I need to be able to check whether a plugin is being run in rosetta as there are some tricky compatibility issues.

I tried using:

#if (JUCE_ARM && JUCE_MAC)

which works for detecting an M1 mac not running Rossetta - but presumably the JUCE_ARM define is set to false if ran as translated from x86-64

Thanks

Bump! I need this too.

Quick Solution

#ifdef JUCE_INTEL
        if (SystemStats::getCpuModel().containsIgnoreCase ("Apple"))
        {
            runsUnderRosetta = true;
        };
#endif
1 Like
        int rosetta = 0;
        size_t rosettaSize = sizeof ( rosetta );
        if ( sysctlbyname ( "sysctl.proc_translated", &rosetta, &rosettaSize, nullptr, 0) == 0)
        {
            if ( rosetta == 1 )
            {
                return true;
            }
        }
2 Likes