These parameters will eventually become private to dmd/target.d, there is also no way for an interfacing compiler backend to their own platforms.
if (global.params.isWindows)
{
item("windows");
}
else
{
item("posix");
if (global.params.isLinux)
item("linux");
else if (global.params.isOSX)
item("osx");
else if (global.params.isFreeBSD)
{
item("freebsd");
item("bsd");
}
else if (global.params.isOpenBSD)
{
item("openbsd");
item("bsd");
}
else if (global.params.isSolaris)
{
item("solaris");
item("bsd");
}
}
Comment #1 by ibuclaw — 2020-09-04T21:39:42Z
(In reply to Iain Buclaw from comment #0)
> These parameters will eventually become private to dmd/target.d, there is
> also no way for an interfacing compiler backend to their own platforms.
>
To highlight why this is important:
1. It wrongly assumes that Windows can never be POSIX (i.e: Cygwin).
2. It wrongly assumes that non-Windows is always POSIX (i.e: RTEMS, Bare-metal)
3. Lacking many other platforms, which would be wrong to hard-code here.
Comment #2 by dlang-bot — 2020-09-04T22:44:09Z
@wilzbach created dlang/dmd pull request #11690 "Issue 20016 - JSON (-X) compilerInfo.platforms generation depends on params.isXXX for platform detection" mentioning this issue:
- Issue 20016 - JSON (-X) compilerInfo.platforms generation depends on params.isXXX for platform detection
Introduce target_platform: Platform as a replacement for TARGET and
is{Windows,Linux, ...}.
https://github.com/dlang/dmd/pull/11690
Comment #3 by robert.schadek — 2024-12-13T19:04:26Z