From 969f333ffe8e0abafa371fae31b8a5237f87f87a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 29 Aug 2010 16:55:58 -0700 Subject: [PATCH] Compiling in atan()/atan2() implementation on Visual Studio 2008. --- VisualC/SDL/SDL_VS2008.vcproj | 8 ++++++++ include/SDL_config_win32.h | 2 ++ src/libm/e_atan2.c | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/VisualC/SDL/SDL_VS2008.vcproj b/VisualC/SDL/SDL_VS2008.vcproj index 75f21c3e6..898da7c28 100644 --- a/VisualC/SDL/SDL_VS2008.vcproj +++ b/VisualC/SDL/SDL_VS2008.vcproj @@ -539,6 +539,10 @@ RelativePath="..\..\src\audio\windx5\directx.h" > + + @@ -579,6 +583,10 @@ RelativePath="..\..\src\video\mmx.h" > + + diff --git a/include/SDL_config_win32.h b/include/SDL_config_win32.h index 86e317252..2ea0e37da 100644 --- a/include/SDL_config_win32.h +++ b/include/SDL_config_win32.h @@ -125,6 +125,8 @@ typedef unsigned int uintptr_t; #define HAVE__STRNICMP 1 #define HAVE_SSCANF 1 #define HAVE_M_PI 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 #define HAVE_CEIL 1 #define HAVE_COPYSIGN 1 #define HAVE_COS 1 diff --git a/src/libm/e_atan2.c b/src/libm/e_atan2.c index 71c916d52..f6974bd12 100644 --- a/src/libm/e_atan2.c +++ b/src/libm/e_atan2.c @@ -57,8 +57,8 @@ double attribute_hidden __ieee754_atan2(double y, double x) ix = hx&0x7fffffff; EXTRACT_WORDS(hy,ly,y); iy = hy&0x7fffffff; - if(((ix|((lx|-lx)>>31))>0x7ff00000)|| - ((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */ + if(((ix|((lx|-(int32_t)lx)>>31))>0x7ff00000)|| + ((iy|((ly|-(int32_t)ly)>>31))>0x7ff00000)) /* x or y is NaN */ return x+y; if(((hx-0x3ff00000)|lx)==0) return atan(y); /* x=1.0 */ m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */