Predefined Versions for Apple Operating Systems
Ogi
ogion.art at gmail.com
Sat Jun 28 12:04:36 UTC 2025
On Thursday, 26 June 2025 at 17:03:33 UTC, Walter Bright wrote:
> Your idea is a good one, but I think it's a bit too late. I'm
> concerned about the disruption it could cause. People with a
> lot of code just don't care for even simple changes like
> search/replace. We've inflicted enough of that.
How about a Phobos module that wraps version identifiers in a
type-safe manner?
Draft:
https://gist.github.com/Ogi-kun/3946759f86ef03ba59dacc81cd6e63e6
```D
import std.config;
static if (isPosix) {
/*...*/
}
else static if (platform == Platform.windows) {
/*...*/
}
else static assert(0, "Unsupported platform");
static if (arch == Arch.x86) {
static if (pointerWidth == P64) {
/*...*/
}
else static if (pointerWidth == P32) {
/*...*/
}
else static assert(0, "This CPU does not exist");
}
else static assert(0, "Unsupported architecture");
```
More information about the Digitalmars-d
mailing list