From 5c383489a7d09fca5834fcd486d4211ca34ca1d0 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 24 Nov 2013 23:36:15 -0500 Subject: [PATCH] We don't need to check for snprintf() anymore, we don't use it. SDL_snprintf() is built on vsnprintf() where available. --- CMakeLists.txt | 3 +-- configure.in | 3 +-- include/SDL_config.h.cmake | 1 - include/SDL_config_android.h | 1 - include/SDL_config_iphoneos.h | 1 - include/SDL_config_macosx.h | 1 - include/SDL_config_pandora.h | 1 - include/SDL_config_psp.h | 1 - include/SDL_config_wiz.h | 1 - premake/Linux/SDL_config_premake.h | 1 - premake/Xcode-iOS/SDL_config_premake.h | 1 - premake/Xcode/Xcode3/SDL_config_premake.h | 1 - premake/Xcode/Xcode4/SDL_config_premake.h | 1 - premake/config/SDL_config_cygwin.template.h | 1 - premake/config/SDL_config_iphoneos.template.h | 1 - premake/config/SDL_config_linux.template.h | 1 - premake/config/SDL_config_macosx.template.h | 1 - 17 files changed, 2 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 30cbaa49727d2..bef514cb8998e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -503,14 +503,13 @@ if(LIBC) check_c_source_compiles("#include #include int main() { }" HAVE_MPROTECT) - # FIXME: we don't care if you have snprintf, etc, any more. We only care if you have vsnprintf. Clean this up. foreach(_FN strtod malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove memcmp strlen strlcpy strlcat strdup _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 snprintf vsnprintf fseeko fseeko64 sigaction setjmp + vsscanf vsnprintf fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname ) string(TOUPPER ${_FN} _UPPER) diff --git a/configure.in b/configure.in index 423620a22cbf6..5a5f7da1e644c 100644 --- a/configure.in +++ b/configure.in @@ -268,8 +268,7 @@ if test x$enable_libc = xyes; then AC_DEFINE(HAVE_MPROTECT, 1, [ ]) ]), ) - dnl FIXME: we don't care if you have snprintf, etc, any more. We only care if you have vsnprintf. Clean this up. - AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _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 snprintf vsnprintf fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname) + AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _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 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname) AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"]) AC_CHECK_FUNCS(atan atan2 acos asin ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt) diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index d0b025d4d5560..e4f9f99fbbb86 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -125,7 +125,6 @@ #cmakedefine HAVE__STRNICMP 1 #cmakedefine HAVE_STRNCASECMP 1 #cmakedefine HAVE_VSSCANF 1 -#cmakedefine HAVE_SNPRINTF 1 #cmakedefine HAVE_VSNPRINTF 1 #cmakedefine HAVE_M_PI 1 #cmakedefine HAVE_ATAN 1 diff --git a/include/SDL_config_android.h b/include/SDL_config_android.h index b0c99fc847856..d9bd9d1c1f6e4 100644 --- a/include/SDL_config_android.h +++ b/include/SDL_config_android.h @@ -82,7 +82,6 @@ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI 1 #define HAVE_ATAN 1 diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h index abe18f14c66c9..348df13c281a4 100644 --- a/include/SDL_config_iphoneos.h +++ b/include/SDL_config_iphoneos.h @@ -80,7 +80,6 @@ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI 1 #define HAVE_ATAN 1 diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h index b89b5534bff4f..1db36464aae5a 100644 --- a/include/SDL_config_macosx.h +++ b/include/SDL_config_macosx.h @@ -83,7 +83,6 @@ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_CEIL 1 #define HAVE_COPYSIGN 1 diff --git a/include/SDL_config_pandora.h b/include/SDL_config_pandora.h index eab66cb400939..4a95de78b29db 100644 --- a/include/SDL_config_pandora.h +++ b/include/SDL_config_pandora.h @@ -82,7 +82,6 @@ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI 1 #define HAVE_CEIL 1 diff --git a/include/SDL_config_psp.h b/include/SDL_config_psp.h index a62477d3626fe..ca7cac603a40e 100644 --- a/include/SDL_config_psp.h +++ b/include/SDL_config_psp.h @@ -80,7 +80,6 @@ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI 1 #define HAVE_ATAN 1 diff --git a/include/SDL_config_wiz.h b/include/SDL_config_wiz.h index 149446e5724db..acfe4fcfd314a 100644 --- a/include/SDL_config_wiz.h +++ b/include/SDL_config_wiz.h @@ -76,7 +76,6 @@ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI 1 #define HAVE_CEIL 1 diff --git a/premake/Linux/SDL_config_premake.h b/premake/Linux/SDL_config_premake.h index 40727f13f0d73..a611c2bb1c0be 100644 --- a/premake/Linux/SDL_config_premake.h +++ b/premake/Linux/SDL_config_premake.h @@ -129,7 +129,6 @@ /* #undef HAVE__STRNICMP */ #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI /**/ #define HAVE_ATAN 1 diff --git a/premake/Xcode-iOS/SDL_config_premake.h b/premake/Xcode-iOS/SDL_config_premake.h index fc4478a674dbe..e885661fd880e 100644 --- a/premake/Xcode-iOS/SDL_config_premake.h +++ b/premake/Xcode-iOS/SDL_config_premake.h @@ -80,7 +80,6 @@ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI 1 #define HAVE_ATAN 1 diff --git a/premake/Xcode/Xcode3/SDL_config_premake.h b/premake/Xcode/Xcode3/SDL_config_premake.h index 1aeefc3d149dc..77dc90eb364bf 100644 --- a/premake/Xcode/Xcode3/SDL_config_premake.h +++ b/premake/Xcode/Xcode3/SDL_config_premake.h @@ -86,7 +86,6 @@ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_CEIL 1 #define HAVE_COPYSIGN 1 diff --git a/premake/Xcode/Xcode4/SDL_config_premake.h b/premake/Xcode/Xcode4/SDL_config_premake.h index 1aeefc3d149dc..77dc90eb364bf 100644 --- a/premake/Xcode/Xcode4/SDL_config_premake.h +++ b/premake/Xcode/Xcode4/SDL_config_premake.h @@ -86,7 +86,6 @@ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_CEIL 1 #define HAVE_COPYSIGN 1 diff --git a/premake/config/SDL_config_cygwin.template.h b/premake/config/SDL_config_cygwin.template.h index d90122ce83968..9e3f9099d1036 100644 --- a/premake/config/SDL_config_cygwin.template.h +++ b/premake/config/SDL_config_cygwin.template.h @@ -125,7 +125,6 @@ /* #undef HAVE__STRNICMP */ #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI /**/ #define HAVE_ATAN 1 diff --git a/premake/config/SDL_config_iphoneos.template.h b/premake/config/SDL_config_iphoneos.template.h index 6450173567ede..7aa74bdc997df 100644 --- a/premake/config/SDL_config_iphoneos.template.h +++ b/premake/config/SDL_config_iphoneos.template.h @@ -80,7 +80,6 @@ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI 1 #define HAVE_ATAN 1 diff --git a/premake/config/SDL_config_linux.template.h b/premake/config/SDL_config_linux.template.h index 5897057ea85c8..0e2477912a7ed 100644 --- a/premake/config/SDL_config_linux.template.h +++ b/premake/config/SDL_config_linux.template.h @@ -129,7 +129,6 @@ /* #undef HAVE__STRNICMP */ #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI /**/ #define HAVE_ATAN 1 diff --git a/premake/config/SDL_config_macosx.template.h b/premake/config/SDL_config_macosx.template.h index 654b2c1df6f22..c53440a4edb74 100644 --- a/premake/config/SDL_config_macosx.template.h +++ b/premake/config/SDL_config_macosx.template.h @@ -86,7 +86,6 @@ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_CEIL 1 #define HAVE_COPYSIGN 1