ReactOS  0.4.14-dev-50-g13bb5e2
merr.c File Reference
#include <internal.h>
#include <math.h>
#include <stdio.h>
Include dependency graph for merr.c:

Go to the source code of this file.

Typedefs

typedef int(__cdeclfUserMathErr) (struct _exception *)
 

Functions

void __mingw_raise_matherr (int typ, const char *name, double a1, double a2, double rslt)
 
void __mingw_setusermatherr (int(__cdecl *f)(struct _exception *))
 
int __CRTDECL _matherr (struct _exception *pexcept)
 

Variables

static fUserMathErr stUserMathErr
 

Typedef Documentation

◆ fUserMathErr

typedef int(__cdecl * fUserMathErr) (struct _exception *)

This file has no copyright assigned and is placed in the Public Domain. This file is part of the w64 mingw-runtime package. No warranty is given; refer to the file DISCLAIMER.PD within this package.

Definition at line 11 of file merr.c.

Function Documentation

◆ __mingw_raise_matherr()

void __mingw_raise_matherr ( int  typ,
const char name,
double  a1,
double  a2,
double  rslt 
)

Definition at line 14 of file merr.c.

16 {
17  struct _exception ex;
18  if (!stUserMathErr)
19  return;
20  ex.type = typ;
21  ex.name = (char*)name;
22  ex.arg1 = a1;
23  ex.arg2 = a2;
24  ex.retval = rslt;
25  (*stUserMathErr)(&ex);
26 }
Definition: comerr.c:44
static fUserMathErr stUserMathErr
Definition: merr.c:12
static const struct update_accum a2
Definition: msg.c:586
Definition: name.c:36
static const struct update_accum a1
Definition: msg.c:578

◆ __mingw_setusermatherr()

void __mingw_setusermatherr ( int(__cdecl *f)(struct _exception *)  )

Definition at line 30 of file merr.c.

31 {
32  stUserMathErr = f;
34 }
void CDECL __setusermatherr(MSVCRT_matherr_func func)
Definition: matherr.c:45
static fUserMathErr stUserMathErr
Definition: merr.c:12
GLfloat f
Definition: glext.h:7540
#define f
Definition: ke_i.h:83

◆ _matherr()

int __CRTDECL _matherr ( struct _exception pexcept)

Definition at line 37 of file merr.c.

38 {
39  const char * type;
40 
41  switch(pexcept->type)
42  {
43  case _DOMAIN:
44  type = "Argument domain error (DOMAIN)";
45  break;
46 
47  case _SING:
48  type = "Argument singularity (SIGN)";
49  break;
50 
51  case _OVERFLOW:
52  type = "Overflow range error (OVERFLOW)";
53  break;
54 
55  case _PLOSS:
56  type = "Partial loss of significance (PLOSS)";
57  break;
58 
59  case _TLOSS:
60  type = "Total loss of significance (TLOSS)";
61  break;
62 
63  case _UNDERFLOW:
64  type = "The result is too small to be represented (UNDERFLOW)";
65  break;
66 
67  default:
68  type = "Unknown error";
69  break;
70  }
71 
72  __mingw_fprintf (stderr, "_matherr(): %s in %s(%g, %g) (retval=%g)\n",
73  type, pexcept->name, pexcept->arg1, pexcept->arg2, pexcept->retval);
74  return 0;
75 }
#define _DOMAIN
Definition: math.h:39
double arg2
Definition: math.h:24
#define _PLOSS
Definition: math.h:44
char * name
Definition: math.h:22
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int type
Definition: math.h:21
#define _SING
Definition: math.h:40
double retval
Definition: math.h:25
#define _TLOSS
Definition: math.h:43
#define _UNDERFLOW
Definition: math.h:42
double arg1
Definition: math.h:23
FILE * stderr
#define _OVERFLOW
Definition: math.h:41

Variable Documentation

◆ stUserMathErr

fUserMathErr stUserMathErr
static

Definition at line 12 of file merr.c.

Referenced by __mingw_raise_matherr(), and __mingw_setusermatherr().