Predefined Versions for Apple Operating Systems

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Sat Jun 21 20:28:56 UTC 2025


On 22/06/2025 8:24 AM, Walter Bright wrote:
> Currently, the following predefined versions exist for Apple operating 
> systems:
> 
> OSX iOS TVOS WatchOS VisionOS
> 
> When I look at druntime source code, I see things like:
> 
> ```d
> version (OSX)
>      version = Darwin;
> else version (iOS)
>      version = Darwin;
> else version (TVOS)
>      version = Darwin;
> else version (WatchOS)
>      version = Darwin;
> ```
> and:
> ```d
> 
> ```d
> version (OSX) {}
> else version (iOS) {}
> else version (TVOS) {}
> else version (WatchOS) {}
> else:
> ```
> appearing ad nauseam.
> 
> (note the conspicuous absence of VisionOS appearing in druntime)
> 
> I propose, like Windows encompassing Win32 and Win64, that __APPLE__ 
> encompass OSX, iOS, TVOS, WatchOS, and VisionOS. __APPLE__ is already 
> standardized in C headers for that purpose.
> 
> The use of "darwin" or "Darwin" appears to be quite obsolete.
> 
> This will clean up a lot of version algebra in the druntime files.

Darwin is still relevant: 
https://en.wikipedia.org/wiki/Darwin_(operating_system)

It encompasses all those Apple OS's according to Wikipedia, and its 
already in place.



More information about the Digitalmars-d mailing list