www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15036] New: SimpleDllMain assumes various symbols are


          Issue ID: 15036
           Summary: SimpleDllMain assumes various symbols are available
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: trivial
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: jakobovrum gmail.com

Code like the following does not compile:

    import core.sys.windows.dll : SimpleDllMain;
    mixin SimpleDllMain;

Because SimpleDllMain depends on dll_process_attach, dll_process_detach,
dll_thread_attach and dll_thread_detach from core.sys.windows.dll. Statically
importing the module, or using a renamed import, would also break the mixin.

It would probably be a robust fix to add:

import core.sys.windows.dll : dll_process_attach, dll_process_detach,
dll_thread_attach, dll_thread_detach;

To the body of the DllMain function inside the mixin.

Sep 11 2015