--- mstools/h/setjmp.h 2018/08/09 18:21:04 1.1.1.3 +++ mstools/h/setjmp.h 2018/08/09 18:22:57 1.1.1.4 @@ -1,7 +1,7 @@ /*** *setjmp.h - definitions/declarations for setjmp/longjmp routines * -* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved. +* Copyright (c) 1985-1993, Microsoft Corporation. All rights reserved. * *Purpose: * This file defines the machine-dependent buffer used by @@ -13,7 +13,9 @@ #ifndef _INC_SETJMP -#ifndef __cplusplus +#ifdef __cplusplus +extern "C" { +#endif /* @@ -28,15 +30,6 @@ #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 /* @@ -58,33 +51,85 @@ /* * MS C8-32 or older MS C6-386 compilers */ +#ifndef _INC_SETJMPEX #define setjmp _setjmp +#endif #define _JBLEN 8 +#define _JBTYPE int -#else - -#ifdef M_MRX000 /* - * Old prototype MS-MIPS compiler + * Define jump buffer layout for x86 setjmp/longjmp. */ -#pragma intrinsic(_setjmp) -#define setjmp _setjmp + +typedef struct __JUMP_BUFFER { + unsigned long Ebp; + unsigned long Ebx; + unsigned long Edi; + unsigned long Esi; + unsigned long Esp; + unsigned long Eip; + unsigned long Registration; + unsigned long TryLevel; +} _JUMP_BUFFER; #else + /* * Assume compiler implements setjmp as a function */ #define _setjmp setjmp #endif + + +#if defined(_M_MRX000) || defined(_MIPS_) +/* + * All MIPS implementations need _JBLEN of 16 + */ +#define _JBLEN 16 +#define _JBTYPE double + +/* + * Define jump buffer layout for MIPS setjmp/longjmp. + */ + +typedef struct __JUMP_BUFFER { + unsigned long FltF20; + unsigned long FltF21; + unsigned long FltF22; + unsigned long FltF23; + unsigned long FltF24; + unsigned long FltF25; + unsigned long FltF26; + unsigned long FltF27; + unsigned long FltF28; + unsigned long FltF29; + unsigned long FltF30; + unsigned long FltF31; + unsigned long IntS0; + unsigned long IntS1; + unsigned long IntS2; + unsigned long IntS3; + unsigned long IntS4; + unsigned long IntS5; + unsigned long IntS6; + unsigned long IntS7; + unsigned long IntS8; + unsigned long IntSp; + unsigned long Type; + unsigned long Fir; +} _JUMP_BUFFER; + #endif +#if defined(_ALPHA_) -#if ( defined(_M_RX000) || defined(M_MRX000) || defined(MIPS) || defined(MIPS) ) /* - * All MIPS implementation need _JBLEN of 2 + * All ALPHA implementations need _JBLEN of 2 */ -#define _JBLEN 2 + +#define _JBLEN 2 +#define _JBTYPE double #endif @@ -94,17 +139,19 @@ /* define the buffer type for holding the state information */ #ifndef _JMP_BUF_DEFINED -typedef int jmp_buf[_JBLEN]; +typedef _JBTYPE jmp_buf[_JBLEN]; #define _JMP_BUF_DEFINED #endif /* function prototypes */ -int _CRTAPI1 _setjmp(jmp_buf); +int _CRTAPI1 setjmp(jmp_buf); void _CRTAPI1 longjmp(jmp_buf, int); -#endif /* __cplusplus */ +#ifdef __cplusplus +} +#endif #define _INC_SETJMP #endif /* _INC_SETJMP */