Compiling in atan()/atan2() implementation on Visual Studio 2008.
authorSam Lantinga <slouken@libsdl.org>
Sun, 29 Aug 2010 16:55:58 -0700
changeset 48748288636b861d
parent 4873 67ad1c88dda0
child 4875 22ce07e8e824
Compiling in atan()/atan2() implementation on Visual Studio 2008.
VisualC/SDL/SDL_VS2008.vcproj
include/SDL_config_win32.h
src/libm/e_atan2.c
     1.1 --- a/VisualC/SDL/SDL_VS2008.vcproj	Sun Aug 29 16:51:48 2010 -0700
     1.2 +++ b/VisualC/SDL/SDL_VS2008.vcproj	Sun Aug 29 16:55:58 2010 -0700
     1.3 @@ -540,6 +540,10 @@
     1.4  			>
     1.5  		</File>
     1.6  		<File
     1.7 +			RelativePath="..\..\src\libm\e_atan2.c"
     1.8 +			>
     1.9 +		</File>
    1.10 +		<File
    1.11  			RelativePath="..\..\src\libm\e_log.c"
    1.12  			>
    1.13  		</File>
    1.14 @@ -580,6 +584,10 @@
    1.15  			>
    1.16  		</File>
    1.17  		<File
    1.18 +			RelativePath="..\..\src\libm\s_atan.c"
    1.19 +			>
    1.20 +		</File>
    1.21 +		<File
    1.22  			RelativePath="..\..\src\libm\s_copysign.c"
    1.23  			>
    1.24  		</File>
     2.1 --- a/include/SDL_config_win32.h	Sun Aug 29 16:51:48 2010 -0700
     2.2 +++ b/include/SDL_config_win32.h	Sun Aug 29 16:55:58 2010 -0700
     2.3 @@ -125,6 +125,8 @@
     2.4  #define HAVE__STRNICMP 1
     2.5  #define HAVE_SSCANF 1
     2.6  #define HAVE_M_PI 1
     2.7 +#define HAVE_ATAN 1
     2.8 +#define HAVE_ATAN2 1
     2.9  #define HAVE_CEIL 1
    2.10  #define HAVE_COPYSIGN 1
    2.11  #define HAVE_COS 1
     3.1 --- a/src/libm/e_atan2.c	Sun Aug 29 16:51:48 2010 -0700
     3.2 +++ b/src/libm/e_atan2.c	Sun Aug 29 16:55:58 2010 -0700
     3.3 @@ -57,8 +57,8 @@
     3.4  	ix = hx&0x7fffffff;
     3.5  	EXTRACT_WORDS(hy,ly,y);
     3.6  	iy = hy&0x7fffffff;
     3.7 -	if(((ix|((lx|-lx)>>31))>0x7ff00000)||
     3.8 -	   ((iy|((ly|-ly)>>31))>0x7ff00000))	/* x or y is NaN */
     3.9 +	if(((ix|((lx|-(int32_t)lx)>>31))>0x7ff00000)||
    3.10 +	   ((iy|((ly|-(int32_t)ly)>>31))>0x7ff00000))	/* x or y is NaN */
    3.11  	   return x+y;
    3.12  	if(((hx-0x3ff00000)|lx)==0) return atan(y);   /* x=1.0 */
    3.13  	m = ((hy>>31)&1)|((hx>>30)&2);	/* 2*sign(x)+sign(y) */