--- mstools/h/math.h 2018/08/09 18:20:01 1.1 +++ mstools/h/math.h 2018/08/09 18:21:04 1.1.1.3 @@ -1,7 +1,7 @@ /*** *math.h - definitions and declarations for math library * -* Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved. +* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved. * *Purpose: * This file contains constant definitions and external subroutine @@ -17,10 +17,38 @@ extern "C" { #endif -#if (_MSC_VER <= 600) -#define __cdecl _cdecl +/* + * 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 + /* definition of _exception struct - this struct is passed to the matherr * routine when a floating point exception is detected */ @@ -79,53 +107,54 @@ struct _complex { * for a value returned in case of error by a number of the floating point * math routines */ - +#ifdef _DLL +#define _HUGE (*_HUGE_dll) +extern double * _HUGE_dll; +#else extern double _HUGE; +#endif + #define HUGE_VAL _HUGE /* function prototypes */ -int abs(int); -double acos(double); -double asin(double); -double atan(double); -double atan2(double, double); -double atof(const char *); -double _cabs(struct _complex); -double ceil(double); -double cos(double); -double cosh(double); -int _dieeetomsbin(double *, double *); -int _dmsbintoieee(double *, double *); -double exp(double); -double fabs(double); -int _fieeetomsbin(float *, float *); -double floor(double); -double fmod(double, double); -int _fmsbintoieee(float *, float *); -double frexp(double, int *); -double _hypot(double, double); -double _j0(double); -double _j1(double); -double _jn(int, double); -long labs(long); -double ldexp(double, int); -double log(double); -double log10(double); -int _matherr(struct _exception *); -double modf(double, double *); -double pow(double, double); -double sin(double); -double sinh(double); -double sqrt(double); -double tan(double); -double tanh(double); -double _y0(double); -double _y1(double); -double _yn(int, double); +int _CRTAPI1 abs(int); +double _CRTAPI1 acos(double); +double _CRTAPI1 asin(double); +double _CRTAPI1 atan(double); +double _CRTAPI1 atan2(double, double); +double _CRTAPI1 atof(const char *); +double _CRTAPI1 _cabs(struct _complex); +double _CRTAPI1 ceil(double); +double _CRTAPI1 cos(double); +double _CRTAPI1 cosh(double); +double _CRTAPI1 exp(double); +double _CRTAPI1 fabs(double); +double _CRTAPI1 floor(double); +double _CRTAPI1 fmod(double, double); +double _CRTAPI1 frexp(double, int *); +double _CRTAPI1 _hypot(double, double); +double _CRTAPI1 _j0(double); +double _CRTAPI1 _j1(double); +double _CRTAPI1 _jn(int, double); +long _CRTAPI1 labs(long); +double _CRTAPI1 ldexp(double, int); +double _CRTAPI1 log(double); +double _CRTAPI1 log10(double); +int _CRTAPI1 _matherr(struct _exception *); +double _CRTAPI1 modf(double, double *); +double _CRTAPI1 pow(double, double); +double _CRTAPI1 sin(double); +double _CRTAPI1 sinh(double); +double _CRTAPI1 sqrt(double); +double _CRTAPI1 tan(double); +double _CRTAPI1 tanh(double); +double _CRTAPI1 _y0(double); +double _CRTAPI1 _y1(double); +double _CRTAPI1 _yn(int, double); -#ifdef i386 +#ifdef _M_IX86 #pragma function(acos, asin, atan, atan2, cos, cosh, exp, fmod, log, log10, pow, sin, sinh, sqrt, tan, tanh) #endif @@ -141,13 +170,14 @@ double _yn(int, double); #define matherr _matherr +#ifdef _DLL +#define HUGE (*HUGE_dll) +extern double * HUGE_dll; +#else extern double HUGE; +#endif #define cabs _cabs -#define dieeetomsbin _dieeetomsbin -#define dmsbintoieee _dmsbintoieee -#define fieeetomsbin _fieeetomsbin -#define fmsbintoieee _fmsbintoieee #define hypot _hypot #define j0 _j0 #define j1 _j1