JUCE_MAC macro is not defined

Hi,

I am trying to use JUCE_MAC macro, but weirdly it does not seem that Introjucer defines it…
That is at least what I see in the generated Xcode project.
And when using it, I also see that in mac, the code #defined in this macro is not compiled.

Am I missing something?
Thx

Nathaniel

You can see where it’s defined in juce_TargetPlatform.h. It uses other compiler flags to detect whether you’re using OSX

But JUCE_MAC is not defined on macOS Monterey. When I use the macro it can not find the functions I used from this header:

#if defined JUCE_MAC
#include <pwd.h>
#endif

but this is working

#if defined (__APPLE_CPP__) || defined (__APPLE_CC__)
#include <pwd.h>
#endif

You first need to

#include “…/JuceLibraryCode/JuceHeader.h”

Rail

Of course we did include the header with #include <JuceHeader.h> … but still the problem that JUCE_MAC is not defined on macOS.

Just wanted to report, that it works here on Monterey 12.4

Please note that even on a Mac, when targeting iOS or iPhone simulator JUCE_MAC is intentionally not set, see here:

HTH