--- mstools/h/setjmp.h 2018/08/09 18:20:01 1.1.1.1 +++ mstools/h/setjmp.h 2018/08/09 18:21:04 1.1.1.3 @@ -1,7 +1,7 @@ /*** *setjmp.h - definitions/declarations for setjmp/longjmp routines * -* Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved. +* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved. * *Purpose: * This file defines the machine-dependent buffer used by @@ -9,41 +9,100 @@ * declarations for those routines. * [ANSI/System V] * -*******************************************************************************/ +****/ #ifndef _INC_SETJMP #ifndef __cplusplus -#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) ) -/* define the buffer type for holding the state information */ +/* + * 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 -#ifndef _JMP_BUF_DEFINED -typedef int jmp_buf[6]; -#define _JMP_BUF_DEFINED #endif /* - * _setjmp compiler intrinsic does not work with current Win32 - * implementation so map it to 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 +/* + * Old prototype MS-MIPS compiler + */ +#pragma intrinsic(_setjmp) +#define setjmp _setjmp + +#else +/* + * Assume compiler implements setjmp as a function */ #define _setjmp setjmp +#endif +#endif + + +#if ( defined(_M_RX000) || defined(M_MRX000) || defined(MIPS) || defined(MIPS) ) +/* + * All MIPS implementation need _JBLEN of 2 + */ +#define _JBLEN 2 + +#endif + + +/* define the buffer type for holding the state information */ + +#ifndef _JMP_BUF_DEFINED +typedef int jmp_buf[_JBLEN]; +#define _JMP_BUF_DEFINED +#endif /* function prototypes */ -int _setjmp(jmp_buf); -void longjmp(jmp_buf, int); +int _CRTAPI1 _setjmp(jmp_buf); +void _CRTAPI1 longjmp(jmp_buf, int); #endif /* __cplusplus */