#pragma once #define CR_CONTEXT int __s; #define CR_COPY(from) __s(from.__s) #define CR_INIT() __s = 0; #define CR_START() switch (__s) { case 0: #define CR_RETURN(x) { __s = __LINE__; return x; case __LINE__: ; } #define CR_RETURN_VOID { __s = __LINE__; return; case __LINE__: ; } #define CR_END() { break; default: for (;;) ; } } __s = 0; #define CR_TERM (__s == 0)