From e5251147badbf2caac628632df741d46a4ab5646 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 16 Feb 2011 12:53:21 +0000 Subject: [PATCH] [WINE] Add math.h for wine code, with NAN and INFINITY as portable constants. svn path=/branches/cmake-bringup/; revision=50731 --- include/reactos/wine/math.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 include/reactos/wine/math.h diff --git a/include/reactos/wine/math.h b/include/reactos/wine/math.h new file mode 100644 index 00000000000..1d86ef9a7df --- /dev/null +++ b/include/reactos/wine/math.h @@ -0,0 +1,26 @@ +#ifndef __WINE_MATH_H_ +#define __WINE_MATH_H_ + +#include + +#ifdef _MSC_VER +__forceinline float _NaN() +{ + unsigned long NaN = 0x7fc00000; + return *(float*)&NaN; +} +#define NAN _NaN() + +__forceinline float _Infinity() +{ + unsigned long Infinity = 0x7f800000; + return *(float*)&Infinity; +} +#define INFINITY _Infinity() + +#else +#define NAN (0.0f / 0.0f) +#define INFINITY (1.0F/0.0F) +#endif + +#endif /* __WINE_MATH_H_ */