--- mstools/h/float.h 2018/08/09 18:20:31 1.1.1.2 +++ mstools/h/float.h 2018/08/09 18:21:10 1.1.1.3 @@ -1,7 +1,7 @@ /*** *float.h - constants for floating point values * -* Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved. +* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved. * *Purpose: * This file contains defines for a number of implementation dependent @@ -18,12 +18,38 @@ extern "C" { #endif -#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 + #define DBL_DIG 15 /* # of decimal digits of precision */ #define DBL_EPSILON 2.2204460492503131e-016 /* smallest such that 1.0+DBL_EPSILON != 1.0 */ #define DBL_MANT_DIG 53 /* # of bits in mantissa */ @@ -67,10 +93,10 @@ extern "C" { /* function prototypes */ -unsigned int _clearfp(void); -unsigned int _controlfp(unsigned int,unsigned int); -unsigned int _statusfp(void); -void _fpreset(void); +unsigned int _CRTAPI1 _clearfp(void); +unsigned int _CRTAPI1 _controlfp(unsigned int,unsigned int); +unsigned int _CRTAPI1 _statusfp(void); +void _CRTAPI1 _fpreset(void); #define _clear87 _clearfp #define _status87 _statusfp @@ -121,7 +147,7 @@ void _fpreset(void); #define _SW_DENORMAL 0x00080000 /* denormal status bit */ -unsigned int _control87(unsigned int,unsigned int); +unsigned int _CRTAPI1 _control87(unsigned int,unsigned int); /* @@ -135,13 +161,11 @@ unsigned int _control87(unsigned int,uns /* initial Control Word value */ -#ifdef i386 +#ifdef _M_IX86 #define _CW_DEFAULT ( _RC_NEAR + _PC_64 + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT ) -#endif - -#ifdef MIPS +#elif ( defined(_M_RX000) || defined(M_MRX000) || defined(MIPS) || defined(MIPS) ) #define _CW_DEFAULT ( _RC_NEAR + _DN_FLUSH + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT ) @@ -150,7 +174,7 @@ unsigned int _control87(unsigned int,uns /* Global variable holding floating point error code */ #ifdef _MT -extern int * __fpecode(void); +extern int * _CRTAPI1 __fpecode(void); #define _fpecode (*__fpecode()) #else extern int _fpecode; @@ -182,14 +206,14 @@ extern int _fpecode; /* IEEE recommended functions */ -double _copysign (double, double); -double _chgsign (double); -double _scalb(double, long); -double _logb(double); -double _nextafter(double, double); -int _finite(double); -int _isnan(double); -int _fpclass(double); +double _CRTAPI1 _copysign (double, double); +double _CRTAPI1 _chgsign (double); +double _CRTAPI1 _scalb(double, long); +double _CRTAPI1 _logb(double); +double _CRTAPI1 _nextafter(double, double); +int _CRTAPI1 _finite(double); +int _CRTAPI1 _isnan(double); +int _CRTAPI1 _fpclass(double); #define _FPCLASS_SNAN 0x0001 /* signaling NaN */ #define _FPCLASS_QNAN 0x0002 /* quiet NaN */