https://issues.dlang.org/show_bug.cgi?id=22953

--- Comment #2 from Adam D. Ruppe <[email protected]> ---
That fails in the event of backported features that didn't bump the version
number (see some in gdc), and in the event of target-specific pragmas, like
`linkerDirective`, which only applies if using a MS-COFF target.

For that one, you can approximate it it with a combination of static if version
> X and version(cruntime_microsoft), but you can target ms-coff with the mingw
runtime too, so this check isn't really correct. If there was a
version(Object_format_COFF) that'd possibly work for this case too but there
isn't one

The best way would be something like __traits(supportsPragma, "") to check it
directly, then you can static if it out.

(though since pragmas are often attached to declarations, that's easier said
than done in general, it'd at least give you the starting point as a reliable
test.)

--

Reply via email to