D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15036 - SimpleDllMain assumes various symbols are available unqualified
Summary: SimpleDllMain assumes various symbols are available unqualified
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All Windows
: P1 trivial
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2015-09-11 10:17 UTC by Jakob Ovrum
Modified: 2015-10-04 18:19 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jakob Ovrum 2015-09-11 10:17:02 UTC
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 Vladimir Panteleev 2015-09-12 18:43:52 UTC
https://github.com/D-Programming-Language/druntime/pull/1385
Comment 2 github-bugzilla 2015-09-12 19:40:07 UTC
Commits pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/957d83f1c342e44229d148027a449c956a42c122
fix Issue 15036 - SimpleDllMain assumes various symbols are available unqualified

https://github.com/D-Programming-Language/druntime/commit/15cde5050c8341fec3c8b5f5ad83eac2a92fe6f3
Merge pull request #1385 from CyberShadow/pull-20150912-184323

fix Issue 15036 - SimpleDllMain assumes various symbols are available…
Comment 3 github-bugzilla 2015-10-04 18:19:22 UTC
Commits pushed to stable at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/957d83f1c342e44229d148027a449c956a42c122
fix Issue 15036 - SimpleDllMain assumes various symbols are available unqualified

https://github.com/D-Programming-Language/druntime/commit/15cde5050c8341fec3c8b5f5ad83eac2a92fe6f3
Merge pull request #1385 from CyberShadow/pull-20150912-184323