October 16, 2018 longjmp [still] crashes on windows? | ||||
---|---|---|---|---|
| ||||
An old thread about the same problem: https://forum.dlang.org/thread/mmxwhdypncaeikknlpyq@forum.dlang.org struct jmp_buf { byte[256] data; } jmp_buf my_jmp_buf; extern(C) { int setjmp(ref jmp_buf env); void longjmp(ref jmp_buf env, int); } void second() { writefln("second"); // calling 'longjmp' results in a crash with '-m64' // it works with '-m32mscoff' longjmp(my_jmp_buf, 1); } void first() { second(); writefln("first"); } void main() { if (setjmp(my_jmp_buf)) { writefln("we longjmp-ed to here"); } else { first(); } } I also want to use '-betterC' (exceptions won't work). |
October 17, 2018 Re: longjmp [still] crashes on windows? | ||||
---|---|---|---|---|
| ||||
Posted in reply to tipdbmp | SrMordred had already figured it (setjmp vs _setjmp(..., null)) out: https://forum.dlang.org/post/abrjmdvvlqdmmnpxcdzh@forum.dlang.org |
Copyright © 1999-2021 by the D Language Foundation