Bug 19195 – Support pragma to specify linker directives
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2018-08-27T02:05:11Z
Last change time
2018-09-06T06:19:02Z
Assigned to
No Owner
Creator
Manu
Comments
Comment #0 by turkeyman — 2018-08-27T02:05:11Z
MSVC emits a bunch of "/FAILIFMISMATCH:" directives to object files.
These express the state of various conditions during compilation, and guard against incorrect linking.
Please add a pragma to emit these to object files in the same way as pragma(lib, ) does for the "/DEFAULTLIB:" directive.
Perhaps a general `pragma(linkdirective, "text")` could be added to support raw directives as required, and future-proof against this class of problem.
For example:
pragma(linkdirective, "/FAILIFMISMATCH:_ITERATOR_DEBUG_LEVEL=2");
May appear in a source file under a version() where struct's are specified accordingly to match such configuration of the MSCRT.