File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,17 +65,6 @@ version (GNU)
6565 import gcc.builtins;
6666}
6767
68- /**
69- * Hook for whatever EH implementation is used to save/restore some data
70- * per stack.
71- *
72- * Params:
73- * newContext = The return value of the prior call to this function
74- * where the stack was last swapped out, or null when a fiber stack
75- * is switched in for the first time.
76- */
77- package extern (C) void * _d_eh_swapContext(void * newContext) nothrow @nogc ;
78-
7968extern (D ) void * swapContext(void * newContext) nothrow @nogc => swapContextImpl(newContext);
8069
8170/**
Original file line number Diff line number Diff line change @@ -112,48 +112,10 @@ version (GNU)
112112 import gcc.builtins;
113113}
114114
115- version (DigitalMars )
115+ private extern (C) void * _d_eh_swapContextDwarf(void * newContext) nothrow @nogc ;
116+ package void * swapContextImpl(void * newContext) nothrow @nogc
116117{
117- extern (C ) void * _d_eh_swapContextDwarf(void * newContext) nothrow @nogc ;
118-
119- package void * swapContextImpl(void * newContext) nothrow @nogc
120- {
121- /* Detect at runtime which scheme is being used.
122- * Eventually, determine it statically.
123- */
124- static int which = 0 ;
125- final switch (which)
126- {
127- case 0 :
128- {
129- assert (newContext == null );
130- auto p = _d_eh_swapContext(newContext);
131- auto pdwarf = _d_eh_swapContextDwarf(newContext);
132- if (p)
133- {
134- which = 1 ;
135- return p;
136- }
137- else if (pdwarf)
138- {
139- which = 2 ;
140- return pdwarf;
141- }
142- return null ;
143- }
144- case 1 :
145- return _d_eh_swapContext (newContext);
146- case 2 :
147- return _d_eh_swapContextDwarf (newContext);
148- }
149- }
150- }
151- else
152- {
153- package void * swapContextImpl(void * newContext) nothrow @nogc
154- {
155- return _d_eh_swapContext (newContext);
156- }
118+ return _d_eh_swapContextDwarf (newContext);
157119}
158120
159121version (WASI )
Original file line number Diff line number Diff line change @@ -47,6 +47,17 @@ version (GNU)
4747 import gcc.builtins;
4848}
4949
50+ /**
51+ * Hook for whatever EH implementation is used to save/restore some data
52+ * per stack.
53+ *
54+ * Params:
55+ * newContext = The return value of the prior call to this function
56+ * where the stack was last swapped out, or null when a fiber stack
57+ * is switched in for the first time.
58+ */
59+ private extern (C) void * _d_eh_swapContext(void * newContext) nothrow @nogc ;
60+
5061package void * swapContextImpl()(void * newContext) nothrow @nogc
5162{
5263 return _d_eh_swapContext (newContext);
You can’t perform that action at this time.
0 commit comments