DARWIN define

Hi,
I found the DARWIN define in the RTL2 source code. I cant see it mentioned here

https://docs.elementscompiler.com/Compiler/ConditionalDefines

Cheers,
John

I’ll check and update. Right now, the docs covers the defined from the compiler (eg ISLAND). There’s literally hundreds und defines that come in from the SDKs and libraries.

Thanks. I was trying to write some code for apple platforms and the conditional defines doc seemed to be missing that one, which appeared to be quite important.

Cocoa is set when your in a mac toffee console but not a mac island one, so there doesnt seem to be anything for apple platforms in both Island and Toffee, so I ended up with

{$IF TOFFEE OR DARWIN}

Hmm, good Q. I thought DARWIN was defined for TOFFEE too…

Jup, it is:

pretty sure that’s in the rtl.fx…

Pro tip, you can see all active defense for the current project (not working in multi-target yet) via the Manage Conditional Defines sheet, if yu check the checkbox at the bottom:

1 Like

Yes I just tried it, so whats COCOA for ? Thats set in Toffee but not Island.

The docs say the island sub platforms are

  • LINUX – for the Linux and Android sub-platforms
  • WINDOWS – for the Windows sub-platform
  • ANDROID – for the Android sub-platform
  • WEBASSEMBLY – for the WebAssembly sub-platform

Why isn’t there a apple specific one ?

I found this piece of code

{$IF ISLAND AND DARWIN AND NOT TOFFEE}

Which led me to believe DARWIN was the missing island subplatform

Correct. it may be badly name din hindsight, but each compiler backend (whatbwe used to refer to as platform) has its code-name define and a real define ECHOES/CLR, COOPER/JAVA , TOFFEE/COCOA. These pairs should be synonymous.

There is, DARWIN, the docs simply are not up to date/incomplete, hence:

That might seem redundant, but it’s not: in ToffeeV2 mode, TOFFEE is defined (for compatibility); the above code will compile for pure Island/Darwin, but not for ToffeeV2.

It is, yes.

1 Like