Added SDL_fmod() and SDL_fmodf()
authorSam Lantinga <slouken@libsdl.org>
Sat, 04 Nov 2017 17:35:03 -0700
changeset 11684eccdf37f8996
parent 11683 48bcba563d9c
child 11685 1788f503254d
Added SDL_fmod() and SDL_fmodf()
CMakeLists.txt
VisualC/SDL/SDL.vcxproj
VisualC/SDL/SDL.vcxproj.filters
configure
configure.in
include/SDL_config.h.cmake
include/SDL_config.h.in
include/SDL_config_android.h
include/SDL_config_iphoneos.h
include/SDL_config_macosx.h
include/SDL_config_psp.h
include/SDL_config_windows.h
include/SDL_config_winrt.h
include/SDL_config_wiz.h
include/SDL_stdinc.h
src/dynapi/SDL_dynapi_overrides.h
src/dynapi/SDL_dynapi_procs.h
src/libm/e_fmod.c
src/libm/s_scalbn.c
src/stdlib/SDL_stdlib.c
     1.1 --- a/CMakeLists.txt	Sat Nov 04 15:53:19 2017 -0700
     1.2 +++ b/CMakeLists.txt	Sat Nov 04 17:35:03 2017 -0700
     1.3 @@ -639,8 +639,8 @@
     1.4              _ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp
     1.5              _stricmp _strnicmp sscanf
     1.6              acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf
     1.7 -            copysign copysignf cos cosf fabs fabsf floor floorf log logf
     1.8 -            pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
     1.9 +            copysign copysignf cos cosf fabs fabsf floor floorf fmod fmodf
    1.10 +            log logf pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
    1.11        string(TOUPPER ${_FN} _UPPER)
    1.12        set(HAVE_${_UPPER} 1)
    1.13      endforeach()
     2.1 --- a/VisualC/SDL/SDL.vcxproj	Sat Nov 04 15:53:19 2017 -0700
     2.2 +++ b/VisualC/SDL/SDL.vcxproj	Sat Nov 04 17:35:03 2017 -0700
     2.3 @@ -414,6 +414,7 @@
     2.4      <ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c" />
     2.5      <ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c" />
     2.6      <ClCompile Include="..\..\src\libm\e_atan2.c" />
     2.7 +    <ClCompile Include="..\..\src\libm\e_fmod.c" />
     2.8      <ClCompile Include="..\..\src\libm\e_log.c" />
     2.9      <ClCompile Include="..\..\src\libm\e_pow.c" />
    2.10      <ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
     3.1 --- a/VisualC/SDL/SDL.vcxproj.filters	Sat Nov 04 15:53:19 2017 -0700
     3.2 +++ b/VisualC/SDL/SDL.vcxproj.filters	Sat Nov 04 17:35:03 2017 -0700
     3.3 @@ -444,8 +444,9 @@
     3.4      <ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
     3.5      <ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
     3.6      <ClCompile Include="..\..\src\video\windows\SDL_windowsvulkan.c" />
     3.7 +    <ClCompile Include="..\..\src\libm\e_fmod.c" />
     3.8    </ItemGroup>
     3.9    <ItemGroup>
    3.10      <ResourceCompile Include="..\..\src\main\windows\version.rc" />
    3.11    </ItemGroup>
    3.12 -</Project>
    3.13 +</Project>
    3.14 \ No newline at end of file
     4.1 --- a/configure	Sat Nov 04 15:53:19 2017 -0700
     4.2 +++ b/configure	Sat Nov 04 17:35:03 2017 -0700
     4.3 @@ -16688,7 +16688,7 @@
     4.4    LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"
     4.5  fi
     4.6  
     4.7 -    for ac_func in acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf fabs fabsf floor floorf log logf pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf
     4.8 +    for ac_func in acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf fabs fabsf floor floorf fmod fmodf log logf pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf
     4.9  do :
    4.10    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
    4.11  ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
     5.1 --- a/configure.in	Sat Nov 04 15:53:19 2017 -0700
     5.2 +++ b/configure.in	Sat Nov 04 17:35:03 2017 -0700
     5.3 @@ -271,7 +271,7 @@
     5.4      AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcscmp strlen strlcpy strlcat _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval poll)
     5.5  
     5.6      AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
     5.7 -    AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf fabs fabsf floor floorf log logf pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
     5.8 +    AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf fabs fabsf floor floorf fmod fmodf log logf pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
     5.9  
    5.10      AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
    5.11      AC_CHECK_FUNCS(iconv)
     6.1 --- a/include/SDL_config.h.cmake	Sat Nov 04 15:53:19 2017 -0700
     6.2 +++ b/include/SDL_config.h.cmake	Sat Nov 04 17:35:03 2017 -0700
     6.3 @@ -148,6 +148,8 @@
     6.4  #cmakedefine HAVE_FABSF 1
     6.5  #cmakedefine HAVE_FLOOR 1
     6.6  #cmakedefine HAVE_FLOORF 1
     6.7 +#cmakedefine HAVE_FMOD 1
     6.8 +#cmakedefine HAVE_FMODF 1
     6.9  #cmakedefine HAVE_LOG 1
    6.10  #cmakedefine HAVE_LOGF 1
    6.11  #cmakedefine HAVE_POW 1
     7.1 --- a/include/SDL_config.h.in	Sat Nov 04 15:53:19 2017 -0700
     7.2 +++ b/include/SDL_config.h.in	Sat Nov 04 17:35:03 2017 -0700
     7.3 @@ -153,6 +153,8 @@
     7.4  #undef HAVE_FABSF
     7.5  #undef HAVE_FLOOR
     7.6  #undef HAVE_FLOORF
     7.7 +#undef HAVE_FMOD
     7.8 +#undef HAVE_FMODF
     7.9  #undef HAVE_LOG
    7.10  #undef HAVE_LOGF
    7.11  #undef HAVE_POW
     8.1 --- a/include/SDL_config_android.h	Sat Nov 04 15:53:19 2017 -0700
     8.2 +++ b/include/SDL_config_android.h	Sat Nov 04 17:35:03 2017 -0700
     8.3 @@ -84,20 +84,32 @@
     8.4  #define HAVE_STRNCASECMP 1
     8.5  #define HAVE_VSSCANF 1
     8.6  #define HAVE_VSNPRINTF  1
     8.7 -#define HAVE_M_PI   1
     8.8 +#define HAVE_ACOS   1
     8.9 +#define HAVE_ACOSF  1
    8.10 +#define HAVE_ASIN   1
    8.11 +#define HAVE_ASINF  1
    8.12  #define HAVE_ATAN   1
    8.13 +#define HAVE_ATANF  1
    8.14  #define HAVE_ATAN2  1
    8.15 -#define HAVE_ACOS  1
    8.16 -#define HAVE_ASIN  1
    8.17 +#define HAVE_ATAN2F 1
    8.18  #define HAVE_CEIL   1
    8.19 +#define HAVE_CEILF  1
    8.20  #define HAVE_COPYSIGN   1
    8.21 +#define HAVE_COPYSIGNF  1
    8.22  #define HAVE_COS    1
    8.23  #define HAVE_COSF   1
    8.24  #define HAVE_FABS   1
    8.25 +#define HAVE_FABSF  1
    8.26  #define HAVE_FLOOR  1
    8.27 +#define HAVE_FLOORF 1
    8.28 +#define HAVE_FMOD   1
    8.29 +#define HAVE_FMODF  1
    8.30  #define HAVE_LOG    1
    8.31 +#define HAVE_LOGF   1
    8.32  #define HAVE_POW    1
    8.33 +#define HAVE_POWF   1
    8.34  #define HAVE_SCALBN 1
    8.35 +#define HAVE_SCALBNF    1
    8.36  #define HAVE_SIN    1
    8.37  #define HAVE_SINF   1
    8.38  #define HAVE_SQRT   1
    8.39 @@ -108,7 +120,7 @@
    8.40  #define HAVE_SETJMP 1
    8.41  #define HAVE_NANOSLEEP  1
    8.42  #define HAVE_SYSCONF    1
    8.43 -#define HAVE_CLOCK_GETTIME	1
    8.44 +#define HAVE_CLOCK_GETTIME  1
    8.45  
    8.46  #define SIZEOF_VOIDP 4
    8.47  
     9.1 --- a/include/SDL_config_iphoneos.h	Sat Nov 04 15:53:19 2017 -0700
     9.2 +++ b/include/SDL_config_iphoneos.h	Sat Nov 04 17:35:03 2017 -0700
     9.3 @@ -85,19 +85,32 @@
     9.4  #define HAVE_VSSCANF 1
     9.5  #define HAVE_VSNPRINTF  1
     9.6  #define HAVE_M_PI   1
     9.7 +#define HAVE_ACOS   1
     9.8 +#define HAVE_ACOSF  1
     9.9 +#define HAVE_ASIN   1
    9.10 +#define HAVE_ASINF  1
    9.11  #define HAVE_ATAN   1
    9.12 +#define HAVE_ATANF  1
    9.13  #define HAVE_ATAN2  1
    9.14 -#define HAVE_ACOS  1
    9.15 -#define HAVE_ASIN  1
    9.16 +#define HAVE_ATAN2F 1
    9.17  #define HAVE_CEIL   1
    9.18 +#define HAVE_CEILF  1
    9.19  #define HAVE_COPYSIGN   1
    9.20 +#define HAVE_COPYSIGNF  1
    9.21  #define HAVE_COS    1
    9.22  #define HAVE_COSF   1
    9.23  #define HAVE_FABS   1
    9.24 +#define HAVE_FABSF  1
    9.25  #define HAVE_FLOOR  1
    9.26 +#define HAVE_FLOORF 1
    9.27 +#define HAVE_FMOD   1
    9.28 +#define HAVE_FMODF  1
    9.29  #define HAVE_LOG    1
    9.30 +#define HAVE_LOGF   1
    9.31  #define HAVE_POW    1
    9.32 +#define HAVE_POWF   1
    9.33  #define HAVE_SCALBN 1
    9.34 +#define HAVE_SCALBNF    1
    9.35  #define HAVE_SIN    1
    9.36  #define HAVE_SINF   1
    9.37  #define HAVE_SQRT   1
    10.1 --- a/include/SDL_config_macosx.h	Sat Nov 04 15:53:19 2017 -0700
    10.2 +++ b/include/SDL_config_macosx.h	Sat Nov 04 17:35:03 2017 -0700
    10.3 @@ -87,15 +87,33 @@
    10.4  #define HAVE_STRNCASECMP 1
    10.5  #define HAVE_VSSCANF 1
    10.6  #define HAVE_VSNPRINTF  1
    10.7 +#define HAVE_M_PI   1
    10.8 +#define HAVE_ACOS   1
    10.9 +#define HAVE_ACOSF  1
   10.10 +#define HAVE_ASIN   1
   10.11 +#define HAVE_ASINF  1
   10.12 +#define HAVE_ATAN   1
   10.13 +#define HAVE_ATANF  1
   10.14 +#define HAVE_ATAN2  1
   10.15 +#define HAVE_ATAN2F 1
   10.16  #define HAVE_CEIL   1
   10.17 +#define HAVE_CEILF  1
   10.18  #define HAVE_COPYSIGN   1
   10.19 +#define HAVE_COPYSIGNF  1
   10.20  #define HAVE_COS    1
   10.21  #define HAVE_COSF   1
   10.22  #define HAVE_FABS   1
   10.23 +#define HAVE_FABSF  1
   10.24  #define HAVE_FLOOR  1
   10.25 +#define HAVE_FLOORF 1
   10.26 +#define HAVE_FMOD   1
   10.27 +#define HAVE_FMODF  1
   10.28  #define HAVE_LOG    1
   10.29 +#define HAVE_LOGF   1
   10.30  #define HAVE_POW    1
   10.31 +#define HAVE_POWF   1
   10.32  #define HAVE_SCALBN 1
   10.33 +#define HAVE_SCALBNF    1
   10.34  #define HAVE_SIN    1
   10.35  #define HAVE_SINF   1
   10.36  #define HAVE_SQRT   1
   10.37 @@ -107,10 +125,6 @@
   10.38  #define HAVE_NANOSLEEP  1
   10.39  #define HAVE_SYSCONF    1
   10.40  #define HAVE_SYSCTLBYNAME 1
   10.41 -#define HAVE_ATAN 1
   10.42 -#define HAVE_ATAN2 1
   10.43 -#define HAVE_ACOS 1
   10.44 -#define HAVE_ASIN 1
   10.45  
   10.46  /* Enable various audio drivers */
   10.47  #define SDL_AUDIO_DRIVER_COREAUDIO  1
    11.1 --- a/include/SDL_config_psp.h	Sat Nov 04 15:53:19 2017 -0700
    11.2 +++ b/include/SDL_config_psp.h	Sat Nov 04 17:35:03 2017 -0700
    11.3 @@ -83,19 +83,32 @@
    11.4  #define HAVE_VSSCANF 1
    11.5  #define HAVE_VSNPRINTF  1
    11.6  #define HAVE_M_PI   1
    11.7 +#define HAVE_ACOS   1
    11.8 +#define HAVE_ACOSF  1
    11.9 +#define HAVE_ASIN   1
   11.10 +#define HAVE_ASINF  1
   11.11  #define HAVE_ATAN   1
   11.12 +#define HAVE_ATANF  1
   11.13  #define HAVE_ATAN2  1
   11.14 -#define HAVE_ACOS  1
   11.15 -#define HAVE_ASIN  1
   11.16 +#define HAVE_ATAN2F 1
   11.17  #define HAVE_CEIL   1
   11.18 +#define HAVE_CEILF  1
   11.19  #define HAVE_COPYSIGN   1
   11.20 +#define HAVE_COPYSIGNF  1
   11.21  #define HAVE_COS    1
   11.22  #define HAVE_COSF   1
   11.23  #define HAVE_FABS   1
   11.24 +#define HAVE_FABSF  1
   11.25  #define HAVE_FLOOR  1
   11.26 +#define HAVE_FLOORF 1
   11.27 +#define HAVE_FMOD   1
   11.28 +#define HAVE_FMODF  1
   11.29  #define HAVE_LOG    1
   11.30 +#define HAVE_LOGF   1
   11.31  #define HAVE_POW    1
   11.32 +#define HAVE_POWF   1
   11.33  #define HAVE_SCALBN 1
   11.34 +#define HAVE_SCALBNF    1
   11.35  #define HAVE_SIN    1
   11.36  #define HAVE_SINF   1
   11.37  #define HAVE_SQRT   1
    12.1 --- a/include/SDL_config_windows.h	Sat Nov 04 15:53:19 2017 -0700
    12.2 +++ b/include/SDL_config_windows.h	Sat Nov 04 17:35:03 2017 -0700
    12.3 @@ -125,30 +125,41 @@
    12.4  #define HAVE_STRNCMP 1
    12.5  #define HAVE__STRICMP 1
    12.6  #define HAVE__STRNICMP 1
    12.7 -#define HAVE_ATAN 1
    12.8 -#define HAVE_ATAN2 1
    12.9 -#define HAVE_ACOS  1
   12.10 -#define HAVE_ASIN  1
   12.11 -#define HAVE_CEIL 1
   12.12 -#define HAVE_COS 1
   12.13 -#define HAVE_COSF 1
   12.14 -#define HAVE_FABS 1
   12.15 -#define HAVE_FLOOR 1
   12.16 -#define HAVE_LOG 1
   12.17 -#define HAVE_POW 1
   12.18 -#define HAVE_SIN 1
   12.19 -#define HAVE_SINF 1
   12.20 -#define HAVE_SQRT 1
   12.21 -#define HAVE_SQRTF 1
   12.22 -#define HAVE_TAN 1
   12.23 -#define HAVE_TANF 1
   12.24 -#define HAVE__COPYSIGN 1
   12.25 +#define HAVE_ACOS   1
   12.26 +#define HAVE_ACOSF  1
   12.27 +#define HAVE_ASIN   1
   12.28 +#define HAVE_ASINF  1
   12.29 +#define HAVE_ATAN   1
   12.30 +#define HAVE_ATANF  1
   12.31 +#define HAVE_ATAN2  1
   12.32 +#define HAVE_ATAN2F 1
   12.33 +#define HAVE_CEILF  1
   12.34 +#define HAVE__COPYSIGN  1
   12.35 +#define HAVE_COS    1
   12.36 +#define HAVE_COSF   1
   12.37 +#define HAVE_FABS   1
   12.38 +#define HAVE_FABSF  1
   12.39 +#define HAVE_FLOOR  1
   12.40 +#define HAVE_FLOORF 1
   12.41 +#define HAVE_FMOD   1
   12.42 +#define HAVE_FMODF  1
   12.43 +#define HAVE_LOG    1
   12.44 +#define HAVE_LOGF   1
   12.45 +#define HAVE_POW    1
   12.46 +#define HAVE_POWF   1
   12.47 +#define HAVE_SIN    1
   12.48 +#define HAVE_SINF   1
   12.49 +#define HAVE_SQRT   1
   12.50 +#define HAVE_SQRTF  1
   12.51 +#define HAVE_TAN    1
   12.52 +#define HAVE_TANF   1
   12.53  #if defined(_MSC_VER)
   12.54  /* These functions were added with the VC++ 2013 C runtime library */
   12.55  #if _MSC_VER >= 1800
   12.56  #define HAVE_STRTOLL 1
   12.57  #define HAVE_VSSCANF 1
   12.58  #define HAVE_SCALBN 1
   12.59 +#define HAVE_SCALBNF    1
   12.60  #endif
   12.61  /* This function is available with at least the VC++ 2008 C runtime library */
   12.62  #if _MSC_VER >= 1400
   12.63 @@ -194,7 +205,7 @@
   12.64  #define SDL_VIDEO_RENDER_D3D    1
   12.65  #endif
   12.66  #ifndef SDL_VIDEO_RENDER_D3D11
   12.67 -#define SDL_VIDEO_RENDER_D3D11	0
   12.68 +#define SDL_VIDEO_RENDER_D3D11  0
   12.69  #endif
   12.70  
   12.71  /* Enable OpenGL support */
    13.1 --- a/include/SDL_config_winrt.h	Sat Nov 04 15:53:19 2017 -0700
    13.2 +++ b/include/SDL_config_winrt.h	Sat Nov 04 17:35:03 2017 -0700
    13.3 @@ -44,7 +44,7 @@
    13.4  
    13.5  #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
    13.6  #if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
    13.7 -#define HAVE_STDINT_H	1
    13.8 +#define HAVE_STDINT_H   1
    13.9  #elif defined(_MSC_VER)
   13.10  typedef signed __int8 int8_t;
   13.11  typedef unsigned __int8 uint8_t;
   13.12 @@ -122,13 +122,13 @@
   13.13  #define HAVE_STRLEN 1
   13.14  #define HAVE__STRREV 1
   13.15  #define HAVE__STRUPR 1
   13.16 -//#define HAVE__STRLWR 1	// TODO, WinRT: consider using _strlwr_s instead
   13.17 +//#define HAVE__STRLWR 1    // TODO, WinRT: consider using _strlwr_s instead
   13.18  #define HAVE_STRCHR 1
   13.19  #define HAVE_STRRCHR 1
   13.20  #define HAVE_STRSTR 1
   13.21  //#define HAVE_ITOA 1   // TODO, WinRT: consider using _itoa_s instead
   13.22 -//#define HAVE__LTOA 1	// TODO, WinRT: consider using _ltoa_s instead
   13.23 -//#define HAVE__ULTOA 1	// TODO, WinRT: consider using _ultoa_s instead
   13.24 +//#define HAVE__LTOA 1  // TODO, WinRT: consider using _ltoa_s instead
   13.25 +//#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead
   13.26  #define HAVE_STRTOL 1
   13.27  #define HAVE_STRTOUL 1
   13.28  //#define HAVE_STRTOLL 1
   13.29 @@ -140,44 +140,56 @@
   13.30  #define HAVE__STRICMP 1
   13.31  #define HAVE__STRNICMP 1
   13.32  #define HAVE_VSNPRINTF 1
   13.33 -//#define HAVE_SSCANF 1	// TODO, WinRT: consider using sscanf_s instead
   13.34 +//#define HAVE_SSCANF 1 // TODO, WinRT: consider using sscanf_s instead
   13.35  #define HAVE_M_PI 1
   13.36 -#define HAVE_ATAN 1
   13.37 -#define HAVE_ATAN2 1
   13.38 -#define HAVE_CEIL 1
   13.39 +#define HAVE_ACOS   1
   13.40 +#define HAVE_ACOSF  1
   13.41 +#define HAVE_ASIN   1
   13.42 +#define HAVE_ASINF  1
   13.43 +#define HAVE_ATAN   1
   13.44 +#define HAVE_ATANF  1
   13.45 +#define HAVE_ATAN2  1
   13.46 +#define HAVE_ATAN2F 1
   13.47 +#define HAVE_CEIL   1
   13.48 +#define HAVE_CEILF  1
   13.49  #define HAVE__COPYSIGN 1
   13.50 -#define HAVE_COS 1
   13.51 -#define HAVE_COSF 1
   13.52 -#define HAVE_FABS 1
   13.53 -#define HAVE_FLOOR 1
   13.54 -#define HAVE_LOG 1
   13.55 -#define HAVE_POW 1
   13.56 -//#define HAVE_SCALBN 1
   13.57 +#define HAVE_COS    1
   13.58 +#define HAVE_COSF   1
   13.59 +#define HAVE_FABS   1
   13.60 +#define HAVE_FABSF  1
   13.61 +#define HAVE_FLOOR  1
   13.62 +#define HAVE_FLOORF 1
   13.63 +#define HAVE_FMOD   1
   13.64 +#define HAVE_FMODF  1
   13.65 +#define HAVE_LOG    1
   13.66 +#define HAVE_LOGF   1
   13.67 +#define HAVE_POW    1
   13.68 +#define HAVE_POWF   1
   13.69  #define HAVE__SCALB 1
   13.70 -#define HAVE_SIN 1
   13.71 -#define HAVE_SINF 1
   13.72 -#define HAVE_SQRT 1
   13.73 -#define HAVE_SQRTF 1
   13.74 -#define HAVE_TAN 1
   13.75 -#define HAVE_TANF 1
   13.76 +#define HAVE_SIN    1
   13.77 +#define HAVE_SINF   1
   13.78 +#define HAVE_SQRT   1
   13.79 +#define HAVE_SQRTF  1
   13.80 +#define HAVE_TAN    1
   13.81 +#define HAVE_TANF   1
   13.82  #define HAVE__FSEEKI64 1
   13.83  
   13.84  /* Enable various audio drivers */
   13.85 -#define SDL_AUDIO_DRIVER_XAUDIO2	1
   13.86 -#define SDL_AUDIO_DRIVER_DISK	1
   13.87 -#define SDL_AUDIO_DRIVER_DUMMY	1
   13.88 +#define SDL_AUDIO_DRIVER_XAUDIO2    1
   13.89 +#define SDL_AUDIO_DRIVER_DISK   1
   13.90 +#define SDL_AUDIO_DRIVER_DUMMY  1
   13.91  
   13.92  /* Enable various input drivers */
   13.93  #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
   13.94  #define SDL_JOYSTICK_DISABLED 1
   13.95 -#define SDL_HAPTIC_DISABLED	1
   13.96 +#define SDL_HAPTIC_DISABLED 1
   13.97  #else
   13.98  #define SDL_JOYSTICK_XINPUT 1
   13.99  #define SDL_HAPTIC_XINPUT   1
  13.100  #endif
  13.101  
  13.102  /* Enable various shared object loading systems */
  13.103 -#define SDL_LOADSO_WINDOWS	1
  13.104 +#define SDL_LOADSO_WINDOWS  1
  13.105  
  13.106  /* Enable various threading systems */
  13.107  #if (NTDDI_VERSION >= NTDDI_WINBLUE)
  13.108 @@ -188,10 +200,10 @@
  13.109  #endif
  13.110  
  13.111  /* Enable various timer systems */
  13.112 -#define SDL_TIMER_WINDOWS	1
  13.113 +#define SDL_TIMER_WINDOWS   1
  13.114  
  13.115  /* Enable various video drivers */
  13.116 -#define SDL_VIDEO_DRIVER_WINRT	1
  13.117 +#define SDL_VIDEO_DRIVER_WINRT  1
  13.118  #define SDL_VIDEO_DRIVER_DUMMY  1
  13.119  
  13.120  /* Enable OpenGL ES 2.0 (via a modified ANGLE library) */
  13.121 @@ -210,7 +222,7 @@
  13.122  
  13.123  /* Enable assembly routines (Win64 doesn't have inline asm) */
  13.124  #ifndef _WIN64
  13.125 -#define SDL_ASSEMBLY_ROUTINES	1
  13.126 +#define SDL_ASSEMBLY_ROUTINES   1
  13.127  #endif
  13.128  
  13.129  #endif /* SDL_config_winrt_h_ */
    14.1 --- a/include/SDL_config_wiz.h	Sat Nov 04 15:53:19 2017 -0700
    14.2 +++ b/include/SDL_config_wiz.h	Sat Nov 04 17:35:03 2017 -0700
    14.3 @@ -80,20 +80,38 @@
    14.4  #define HAVE_VSSCANF 1
    14.5  #define HAVE_VSNPRINTF 1
    14.6  #define HAVE_M_PI 1
    14.7 -#define HAVE_CEIL 1
    14.8 -#define HAVE_COPYSIGN 1
    14.9 -#define HAVE_COS 1
   14.10 -#define HAVE_COSF 1
   14.11 -#define HAVE_FABS 1
   14.12 -#define HAVE_FLOOR 1
   14.13 -#define HAVE_LOG 1
   14.14 +#define HAVE_ACOS   1
   14.15 +#define HAVE_ACOSF  1
   14.16 +#define HAVE_ASIN   1
   14.17 +#define HAVE_ASINF  1
   14.18 +#define HAVE_ATAN   1
   14.19 +#define HAVE_ATANF  1
   14.20 +#define HAVE_ATAN2  1
   14.21 +#define HAVE_ATAN2F 1
   14.22 +#define HAVE_CEIL   1
   14.23 +#define HAVE_CEILF  1
   14.24 +#define HAVE_COPYSIGN   1
   14.25 +#define HAVE_COPYSIGNF  1
   14.26 +#define HAVE_COS    1
   14.27 +#define HAVE_COSF   1
   14.28 +#define HAVE_FABS   1
   14.29 +#define HAVE_FABSF  1
   14.30 +#define HAVE_FLOOR  1
   14.31 +#define HAVE_FLOORF 1
   14.32 +#define HAVE_FMOD   1
   14.33 +#define HAVE_FMODF  1
   14.34 +#define HAVE_LOG    1
   14.35 +#define HAVE_LOGF   1
   14.36 +#define HAVE_POW    1
   14.37 +#define HAVE_POWF   1
   14.38  #define HAVE_SCALBN 1
   14.39 -#define HAVE_SIN 1
   14.40 -#define HAVE_SINF 1
   14.41 -#define HAVE_SQRT 1
   14.42 -#define HAVE_SQRTF 1
   14.43 -#define HAVE_TAN 1
   14.44 -#define HAVE_TANF 1
   14.45 +#define HAVE_SCALBNF    1
   14.46 +#define HAVE_SIN    1
   14.47 +#define HAVE_SINF   1
   14.48 +#define HAVE_SQRT   1
   14.49 +#define HAVE_SQRTF  1
   14.50 +#define HAVE_TAN    1
   14.51 +#define HAVE_TANF   1
   14.52  #define HAVE_SIGACTION 1
   14.53  #define HAVE_SETJMP 1
   14.54  #define HAVE_NANOSLEEP 1
    15.1 --- a/include/SDL_stdinc.h	Sat Nov 04 15:53:19 2017 -0700
    15.2 +++ b/include/SDL_stdinc.h	Sat Nov 04 17:35:03 2017 -0700
    15.3 @@ -518,6 +518,8 @@
    15.4  extern DECLSPEC float SDLCALL SDL_fabsf(float x);
    15.5  extern DECLSPEC double SDLCALL SDL_floor(double x);
    15.6  extern DECLSPEC float SDLCALL SDL_floorf(float x);
    15.7 +extern DECLSPEC double SDLCALL SDL_fmod(double x, double y);
    15.8 +extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y);
    15.9  extern DECLSPEC double SDLCALL SDL_log(double x);
   15.10  extern DECLSPEC float SDLCALL SDL_logf(float x);
   15.11  extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
    16.1 --- a/src/dynapi/SDL_dynapi_overrides.h	Sat Nov 04 15:53:19 2017 -0700
    16.2 +++ b/src/dynapi/SDL_dynapi_overrides.h	Sat Nov 04 17:35:03 2017 -0700
    16.3 @@ -658,3 +658,5 @@
    16.4  #define SDL_logf SDL_logf_REAL
    16.5  #define SDL_powf SDL_powf_REAL
    16.6  #define SDL_scalbnf SDL_scalbnf_REAL
    16.7 +#define SDL_fmod SDL_fmod_REAL
    16.8 +#define SDL_fmodf SDL_fmodf_REAL
    17.1 --- a/src/dynapi/SDL_dynapi_procs.h	Sat Nov 04 15:53:19 2017 -0700
    17.2 +++ b/src/dynapi/SDL_dynapi_procs.h	Sat Nov 04 17:35:03 2017 -0700
    17.3 @@ -692,3 +692,5 @@
    17.4  SDL_DYNAPI_PROC(float,SDL_logf,(float a),(a),return)
    17.5  SDL_DYNAPI_PROC(float,SDL_powf,(float a, float b),(a,b),return)
    17.6  SDL_DYNAPI_PROC(float,SDL_scalbnf,(float a, int b),(a,b),return)
    17.7 +SDL_DYNAPI_PROC(double,SDL_fmod,(double a, double b),(a,b),return)
    17.8 +SDL_DYNAPI_PROC(float,SDL_fmodf,(float a, float b),(a,b),return)
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/src/libm/e_fmod.c	Sat Nov 04 17:35:03 2017 -0700
    18.3 @@ -0,0 +1,144 @@
    18.4 +/*
    18.5 + * ====================================================
    18.6 + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
    18.7 + *
    18.8 + * Developed at SunPro, a Sun Microsystems, Inc. business.
    18.9 + * Permission to use, copy, modify, and distribute this
   18.10 + * software is freely granted, provided that this notice
   18.11 + * is preserved.
   18.12 + * ====================================================
   18.13 + */
   18.14 +
   18.15 +/*
   18.16 + * __ieee754_fmod(x,y)
   18.17 + * Return x mod y in exact arithmetic
   18.18 + * Method: shift and subtract
   18.19 + */
   18.20 +
   18.21 +#include "math_libm.h"
   18.22 +#include "math_private.h"
   18.23 +
   18.24 +static const double one = 1.0, Zero[] = {0.0, -0.0,};
   18.25 +
   18.26 +double attribute_hidden __ieee754_fmod(double x, double y)
   18.27 +{
   18.28 +	int32_t n,hx,hy,hz,ix,iy,sx,i;
   18.29 +	u_int32_t lx,ly,lz;
   18.30 +
   18.31 +	EXTRACT_WORDS(hx,lx,x);
   18.32 +	EXTRACT_WORDS(hy,ly,y);
   18.33 +	sx = hx&0x80000000;		/* sign of x */
   18.34 +	hx ^=sx;		/* |x| */
   18.35 +	hy &= 0x7fffffff;	/* |y| */
   18.36 +
   18.37 +    /* purge off exception values */
   18.38 +	if((hy|ly)==0||(hx>=0x7ff00000)||	/* y=0,or x not finite */
   18.39 +	  ((hy|((ly|-ly)>>31))>0x7ff00000))	/* or y is NaN */
   18.40 +	    return (x*y)/(x*y);
   18.41 +	if(hx<=hy) {
   18.42 +	    if((hx<hy)||(lx<ly)) return x;	/* |x|<|y| return x */
   18.43 +	    if(lx==ly)
   18.44 +		return Zero[(u_int32_t)sx>>31];	/* |x|=|y| return x*0*/
   18.45 +	}
   18.46 +
   18.47 +    /* determine ix = ilogb(x) */
   18.48 +	if(hx<0x00100000) {	/* subnormal x */
   18.49 +	    if(hx==0) {
   18.50 +		for (ix = -1043, i=lx; i>0; i<<=1) ix -=1;
   18.51 +	    } else {
   18.52 +		for (ix = -1022,i=(hx<<11); i>0; i<<=1) ix -=1;
   18.53 +	    }
   18.54 +	} else ix = (hx>>20)-1023;
   18.55 +
   18.56 +    /* determine iy = ilogb(y) */
   18.57 +	if(hy<0x00100000) {	/* subnormal y */
   18.58 +	    if(hy==0) {
   18.59 +		for (iy = -1043, i=ly; i>0; i<<=1) iy -=1;
   18.60 +	    } else {
   18.61 +		for (iy = -1022,i=(hy<<11); i>0; i<<=1) iy -=1;
   18.62 +	    }
   18.63 +	} else iy = (hy>>20)-1023;
   18.64 +
   18.65 +    /* set up {hx,lx}, {hy,ly} and align y to x */
   18.66 +	if(ix >= -1022)
   18.67 +	    hx = 0x00100000|(0x000fffff&hx);
   18.68 +	else {		/* subnormal x, shift x to normal */
   18.69 +	    n = -1022-ix;
   18.70 +	    if(n<=31) {
   18.71 +	        hx = (hx<<n)|(lx>>(32-n));
   18.72 +	        lx <<= n;
   18.73 +	    } else {
   18.74 +		hx = lx<<(n-32);
   18.75 +		lx = 0;
   18.76 +	    }
   18.77 +	}
   18.78 +	if(iy >= -1022)
   18.79 +	    hy = 0x00100000|(0x000fffff&hy);
   18.80 +	else {		/* subnormal y, shift y to normal */
   18.81 +	    n = -1022-iy;
   18.82 +	    if(n<=31) {
   18.83 +	        hy = (hy<<n)|(ly>>(32-n));
   18.84 +	        ly <<= n;
   18.85 +	    } else {
   18.86 +		hy = ly<<(n-32);
   18.87 +		ly = 0;
   18.88 +	    }
   18.89 +	}
   18.90 +
   18.91 +    /* fix point fmod */
   18.92 +	n = ix - iy;
   18.93 +	while(n--) {
   18.94 +	    hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
   18.95 +	    if(hz<0){hx = hx+hx+(lx>>31); lx = lx+lx;}
   18.96 +	    else {
   18.97 +	    	if((hz|lz)==0) 		/* return sign(x)*0 */
   18.98 +		    return Zero[(u_int32_t)sx>>31];
   18.99 +	    	hx = hz+hz+(lz>>31); lx = lz+lz;
  18.100 +	    }
  18.101 +	}
  18.102 +	hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
  18.103 +	if(hz>=0) {hx=hz;lx=lz;}
  18.104 +
  18.105 +    /* convert back to floating value and restore the sign */
  18.106 +	if((hx|lx)==0) 			/* return sign(x)*0 */
  18.107 +	    return Zero[(u_int32_t)sx>>31];
  18.108 +	while(hx<0x00100000) {		/* normalize x */
  18.109 +	    hx = hx+hx+(lx>>31); lx = lx+lx;
  18.110 +	    iy -= 1;
  18.111 +	}
  18.112 +	if(iy>= -1022) {	/* normalize output */
  18.113 +	    hx = ((hx-0x00100000)|((iy+1023)<<20));
  18.114 +	    INSERT_WORDS(x,hx|sx,lx);
  18.115 +	} else {		/* subnormal output */
  18.116 +	    n = -1022 - iy;
  18.117 +	    if(n<=20) {
  18.118 +		lx = (lx>>n)|((u_int32_t)hx<<(32-n));
  18.119 +		hx >>= n;
  18.120 +	    } else if (n<=31) {
  18.121 +		lx = (hx<<(32-n))|(lx>>n); hx = sx;
  18.122 +	    } else {
  18.123 +		lx = hx>>(n-32); hx = sx;
  18.124 +	    }
  18.125 +	    INSERT_WORDS(x,hx|sx,lx);
  18.126 +	    x *= one;		/* create necessary signal */
  18.127 +	}
  18.128 +	return x;		/* exact output */
  18.129 +}
  18.130 +
  18.131 +/*
  18.132 + * wrapper fmod(x,y)
  18.133 + */
  18.134 +#ifndef _IEEE_LIBM
  18.135 +double fmod(double x, double y)
  18.136 +{
  18.137 +	double z = __ieee754_fmod(x, y);
  18.138 +	if (_LIB_VERSION == _IEEE_ || isnan(y) || isnan(x))
  18.139 +		return z;
  18.140 +	if (y == 0.0)
  18.141 +		return __kernel_standard(x, y, 27); /* fmod(x,0) */
  18.142 +	return z;
  18.143 +}
  18.144 +#else
  18.145 +strong_alias(__ieee754_fmod, fmod)
  18.146 +#endif
  18.147 +libm_hidden_def(fmod)
    19.1 --- a/src/libm/s_scalbn.c	Sat Nov 04 15:53:19 2017 -0700
    19.2 +++ b/src/libm/s_scalbn.c	Sat Nov 04 17:35:03 2017 -0700
    19.3 @@ -61,17 +61,9 @@
    19.4  }
    19.5  libm_hidden_def(scalbln)
    19.6  
    19.7 -#if LONG_MAX == INT_MAX
    19.8 -/* strong_alias(scalbln, scalbn) - "error: conflicting types for 'scalbn'"
    19.9 - * because it tries to declare "typeof(scalbln) scalbn;"
   19.10 - * which tries to give "long" parameter to scalbn.
   19.11 - * Doing it by hand:
   19.12 - */
   19.13 -__typeof(scalbn) scalbn __attribute__((alias("scalbln")));
   19.14 -#else
   19.15 +
   19.16  double scalbn(double x, int n)
   19.17  {
   19.18  	return scalbln(x, n);
   19.19  }
   19.20 -#endif
   19.21  libm_hidden_def(scalbn)
    20.1 --- a/src/stdlib/SDL_stdlib.c	Sat Nov 04 15:53:19 2017 -0700
    20.2 +++ b/src/stdlib/SDL_stdlib.c	Sat Nov 04 17:35:03 2017 -0700
    20.3 @@ -148,7 +148,7 @@
    20.4  #if defined(HAVE_CEILF)
    20.5      return ceilf(x);
    20.6  #else
    20.7 -    return (float)ceil((float)x);
    20.8 +    return (float)SDL_ceil((float)x);
    20.9  #endif
   20.10  }
   20.11  
   20.12 @@ -241,6 +241,26 @@
   20.13  }
   20.14  
   20.15  double
   20.16 +SDL_fmod(double x, double y)
   20.17 +{
   20.18 +#if defined(HAVE_FMOD)
   20.19 +    return fmod(x, y);
   20.20 +#else
   20.21 +    return SDL_uclibc_fmod(x, y);
   20.22 +#endif
   20.23 +}
   20.24 +
   20.25 +float
   20.26 +SDL_fmodf(float x, float y)
   20.27 +{
   20.28 +#if defined(HAVE_FMODF)
   20.29 +    return fmodf(x, y);
   20.30 +#else
   20.31 +    return (float)SDL_fmod((double)x, (double)y);
   20.32 +#endif
   20.33 +}
   20.34 +
   20.35 +double
   20.36  SDL_log(double x)
   20.37  {
   20.38  #if defined(HAVE_LOG)