mirror of
https://github.com/reactos/reactos.git
synced 2024-09-07 03:11:07 +00:00
![Timo Kreuzer](/assets/img/avatar_default.png)
The code is mostly unchanged. This includes the following changes: * Move all wine code to crt/wine to keep it separated from our own code * Add a minimal winternl.h * Remove the asm macros from wine/config.h * Include wine/asm.h where required * Fix the names of the exported functions (GCC uses thiscall now and no wrappers are used anymore)
50 lines
1 KiB
C
50 lines
1 KiB
C
#include <precomp.h>
|
|
|
|
#define __USE_ISOC9X 1
|
|
#define __USE_ISOC99 1
|
|
#include <math.h>
|
|
|
|
#ifdef HAVE_IEEEFP_H
|
|
#include <ieeefp.h>
|
|
#endif
|
|
|
|
#ifndef HAVE_FINITE
|
|
#ifndef finite /* Could be a macro */
|
|
#ifdef isfinite
|
|
#define finite(x) isfinite(x)
|
|
#else
|
|
#define finite(x) (!isnan(x)) /* At least catch some cases */
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef signbit
|
|
#define signbit(x) 0
|
|
#endif
|
|
|
|
typedef int (*MSVCRT_matherr_func)(struct _exception *);
|
|
|
|
static MSVCRT_matherr_func MSVCRT_default_matherr_func = NULL;
|
|
|
|
int CDECL _matherr(struct _exception *e)
|
|
{
|
|
if (e)
|
|
TRACE("(%p = %d, %s, %g %g %g)\n",e, e->type, e->name, e->arg1, e->arg2,
|
|
e->retval);
|
|
else
|
|
TRACE("(null)\n");
|
|
if (MSVCRT_default_matherr_func)
|
|
return MSVCRT_default_matherr_func(e);
|
|
ERR(":Unhandled math error!\n");
|
|
return 0;
|
|
}
|
|
|
|
/*********************************************************************
|
|
* __setusermatherr (MSVCRT.@)
|
|
*/
|
|
void CDECL __setusermatherr(MSVCRT_matherr_func func)
|
|
{
|
|
MSVCRT_default_matherr_func = func;
|
|
TRACE(":new matherr handler %p\n", func);
|
|
}
|