changeset 4874:8288636b861d

Compiling in atan()/atan2() implementation on Visual Studio 2008.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 29 Aug 2010 16:55:58 -0700
parents 67ad1c88dda0
children 22ce07e8e824
files VisualC/SDL/SDL_VS2008.vcproj include/SDL_config_win32.h src/libm/e_atan2.c
diffstat 3 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/VisualC/SDL/SDL_VS2008.vcproj	Sun Aug 29 16:51:48 2010 -0700
+++ b/VisualC/SDL/SDL_VS2008.vcproj	Sun Aug 29 16:55:58 2010 -0700
@@ -540,6 +540,10 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\libm\e_atan2.c"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\libm\e_log.c"
 			>
 		</File>
@@ -580,6 +584,10 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\libm\s_atan.c"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\libm\s_copysign.c"
 			>
 		</File>
--- a/include/SDL_config_win32.h	Sun Aug 29 16:51:48 2010 -0700
+++ b/include/SDL_config_win32.h	Sun Aug 29 16:55:58 2010 -0700
@@ -125,6 +125,8 @@
 #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
--- a/src/libm/e_atan2.c	Sun Aug 29 16:51:48 2010 -0700
+++ b/src/libm/e_atan2.c	Sun Aug 29 16:55:58 2010 -0700
@@ -57,8 +57,8 @@
 	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) */