www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18999] New: MSCRT selection specifies _ITERATOR_DEBUG_LEVEL


          Issue ID: 18999
           Summary: MSCRT selection specifies _ITERATOR_DEBUG_LEVEL and
                    produces a `version`
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: turkeyman gmail.com

For Win32/Win64, `_ITERATOR_DEBUG_LEVEL` needs to be embedded in the binary
with the value 0 or 2 matching the version of mscrt that was selected.
0 for release runtime, 2 for debug runtime.
If no crt is selected, then it should be omitted.

This will allow D objects to link against C++ objects that were built for the
respective runtime.

We also need a version() for the mscrt selected at compile time, so that we can
guide struct contents against the runtime selected (STL structs have different
content based on _ITERATOR_DEBUG_LEVEL)

A resolution to this problem might be if only a version were specified, and
also a pragma that allowed embedding _ITERATOR_DEBUG_LEVEL only when a module
imports a `core.stdcpp` module. That way only objects that interact with STL
would entail the linkage problems associated with microsoft's runtime.

Jun 16 2018