This repository was archived by the owner on Oct 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -123,23 +123,20 @@ version (Solaris)
123
123
*/
124
124
private extern (C) void * _d_eh_swapContext(void * newContext) nothrow @nogc ;
125
125
126
- private mixin template swapContextDefault()
127
- {
128
- extern (C ) void * swapContext(void * newContext) nothrow @nogc
129
- {
130
- return _d_eh_swapContext (newContext);
131
- }
132
- }
133
-
134
126
version (DigitalMars )
135
127
{
136
128
version (Windows )
137
- mixin swapContextDefault;
129
+ {
130
+ extern (D ) void * swapContext(void * newContext) nothrow @nogc
131
+ {
132
+ return _d_eh_swapContext (newContext);
133
+ }
134
+ }
138
135
else
139
136
{
140
137
extern (C ) void * _d_eh_swapContextDwarf(void * newContext) nothrow @nogc ;
141
138
142
- extern (C ) void * swapContext(void * newContext) nothrow @nogc
139
+ extern (D ) void * swapContext(void * newContext) nothrow @nogc
143
140
{
144
141
/* Detect at runtime which scheme is being used.
145
142
* Eventually, determine it statically.
@@ -173,7 +170,12 @@ version (DigitalMars)
173
170
}
174
171
}
175
172
else
176
- mixin swapContextDefault;
173
+ {
174
+ extern (D ) void * swapContext(void * newContext) nothrow @nogc
175
+ {
176
+ return _d_eh_swapContext (newContext);
177
+ }
178
+ }
177
179
178
180
// /////////////////////////////////////////////////////////////////////////////
179
181
// Thread
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ private
82
82
enum mutexAlign = classInstanceAlignment! Mutex ;
83
83
enum mutexClassInstanceSize = __traits(classInstanceSize, Mutex );
84
84
85
- extern ( C ) void * swapContext (void * newContext ) nothrow @nogc ;
85
+ alias swapContext = externDFunc ! ( " core.thread.osthread.swapContext " , void * function (void * ) nothrow @nogc ) ;
86
86
87
87
alias getStackBottom = externDFunc! (" core.thread.osthread.getStackBottom" , void * function () nothrow @nogc );
88
88
alias getStackTop = externDFunc! (" core.thread.osthread.getStackTop" , void * function () nothrow @nogc );
You can’t perform that action at this time.
0 commit comments