/+version (Windows) { const size_t _JBLEN = 16; } else { const size_t _JBLEN = 10; } typedef int[_JBLEN] jmp_buf;+/ module std.c.setjmp; pragma(lib, "snn.lib"); extern (C): void longjmp(inout jmp_buf, int); version (Windows) { /* Define jump buffer layout for setjmp/longjmp under NT that unwinds * stack */ struct jmp_buf { uint Ebp; uint Ebx; uint Edi; uint Esi; uint Esp; uint Eip; uint Except_Registration; uint TryLevel; uint Reserved; uint Unwind_Handler; uint[6] ExceptData; } } else { struct jmp_buf { uint j_sp; uint j_ss; uint j_flag; uint j_cs; uint j_ip; uint j_bp; uint j_di; uint j_es; uint j_si; uint j_ds; } } int _setjmp(out jmp_buf); alias _setjmp setjmp; version (linux) { /* #if M_UNIX || M_XENIX #if !__STDC__ || defined(_POSIX_SOURCE) || defined(_XOPEN_SOURCE) */ const size_t _SIGJBLEN = 128; typedef int[_SIGJBLEN] sigjmp_buf; int sigsetjmp(out sigjmp_buf, int); void siglongjmp(inout sigjmp_buf, int); }