--- mstools/h/setjmp.h 2018/08/09 18:20:27 1.1.1.2 +++ mstools/h/setjmp.h 2018/08/09 18:21:04 1.1.1.3 @@ -9,43 +9,82 @@ * declarations for those routines. * [ANSI/System V] * -*******************************************************************************/ +****/ #ifndef _INC_SETJMP #ifndef __cplusplus -#ifndef MIPS -#if (_MSC_VER <= 600) -#define __cdecl _cdecl -#endif +/* + * Conditional macro definition for function calling type and variable type + * qualifiers. + */ +#if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) ) + +/* + * Definitions for MS C8-32 (386/486) compiler + */ +#define _CRTAPI1 __cdecl +#define _CRTAPI2 __cdecl + +#elif ( _MSC_VER == 600 ) + +/* + * Definitions for old MS C6-386 compiler + */ +#define _CRTAPI1 _cdecl +#define _CRTAPI2 _cdecl +#define _M_IX86 300 + +#else + +/* + * Other compilers (e.g., MIPS) + */ +#define _CRTAPI1 +#define _CRTAPI2 + #endif -#ifdef i386 -#define setjmp _setjmp +/* + * Definitions specific to particular setjmp implementations. + */ +#ifdef _M_IX86 +/* + * MS C8-32 or older MS C6-386 compilers + */ +#define setjmp _setjmp #define _JBLEN 8 #else +#ifdef M_MRX000 /* - * _setjmp compiler intrinsic does not work with current Win32 - * implementation so map it to setjmp + * Old prototype MS-MIPS compiler */ -#ifdef M_MRX000 #pragma intrinsic(_setjmp) #define setjmp _setjmp + #else -#define _setjmp setjmp -#endif +/* + * Assume compiler implements setjmp as a function + */ +#define _setjmp setjmp -#ifdef MIPS -#define _JBLEN 2 /* virtual frame and target ip */ #endif +#endif + + +#if ( defined(_M_RX000) || defined(M_MRX000) || defined(MIPS) || defined(MIPS) ) +/* + * All MIPS implementation need _JBLEN of 2 + */ +#define _JBLEN 2 #endif @@ -62,8 +101,8 @@ typedef int jmp_buf[_JBLEN]; /* function prototypes */ -int _setjmp(jmp_buf); -void longjmp(jmp_buf, int); +int _CRTAPI1 _setjmp(jmp_buf); +void _CRTAPI1 longjmp(jmp_buf, int); #endif /* __cplusplus */