Bug 15036 – SimpleDllMain assumes various symbols are available unqualified
Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2015-09-11T10:17:00Z
Last change time
2015-10-04T18:19:22Z
Keywords
pull
Assigned to
nobody
Creator
jakobovrum
Comments
Comment #0 by jakobovrum — 2015-09-11T10:17:02Z
Code like the following does not compile:
version(Windows)
{
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.
Comment #1 by dlang-bugzilla — 2015-09-12T18:43:52Z