Added _strnicmp support
authorSam Lantinga <slouken@libsdl.org>
Mon, 13 Mar 2006 02:12:39 +0000
changeset 1512845b1619c8f6
parent 1511 de816bde0bf1
child 1513 13a3520a13f9
Added _strnicmp support
configure.in
include/SDL_config.h.in
include/SDL_config_win32.h
include/SDL_stdinc.h
src/stdlib/SDL_string.c
     1.1 --- a/configure.in	Mon Mar 13 02:12:15 2006 +0000
     1.2 +++ b/configure.in	Mon Mar 13 02:12:39 2006 +0000
     1.3 @@ -116,7 +116,7 @@
     1.4      if test x$ac_cv_func_strtod = xyes; then
     1.5          AC_DEFINE(HAVE_STRTOD)
     1.6      fi
     1.7 -    AC_CHECK_FUNCS(malloc calloc realloc free getenv 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 strncasecmp sscanf snprintf vsnprintf iconv sigaction setjmp nanosleep)
     1.8 +    AC_CHECK_FUNCS(malloc calloc realloc free getenv 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 sscanf snprintf vsnprintf iconv sigaction setjmp nanosleep)
     1.9  
    1.10      AC_CHECK_LIB(m, pow, [BUILD_LDFLAGS="$BUILD_LDFLAGS -lm"])
    1.11  fi
     2.1 --- a/include/SDL_config.h.in	Mon Mar 13 02:12:15 2006 +0000
     2.2 +++ b/include/SDL_config.h.in	Mon Mar 13 02:12:39 2006 +0000
     2.3 @@ -119,6 +119,7 @@
     2.4  #undef HAVE_STRNCMP
     2.5  #undef HAVE__STRICMP
     2.6  #undef HAVE_STRCASECMP
     2.7 +#undef HAVE__STRNICMP
     2.8  #undef HAVE_STRNCASECMP
     2.9  #undef HAVE_SSCANF
    2.10  #undef HAVE_SNPRINTF
     3.1 --- a/include/SDL_config_win32.h	Mon Mar 13 02:12:15 2006 +0000
     3.2 +++ b/include/SDL_config_win32.h	Mon Mar 13 02:12:39 2006 +0000
     3.3 @@ -103,6 +103,7 @@
     3.4  #define HAVE_STRCMP 1
     3.5  #define HAVE_STRNCMP 1
     3.6  #define HAVE__STRICMP 1
     3.7 +#define HAVE__STRNICMP 1
     3.8  #define HAVE_SSCANF 1
     3.9  #else
    3.10  #define HAVE_STDARG_H	1
     4.1 --- a/include/SDL_stdinc.h	Mon Mar 13 02:12:15 2006 +0000
     4.2 +++ b/include/SDL_stdinc.h	Mon Mar 13 02:12:39 2006 +0000
     4.3 @@ -523,6 +523,8 @@
     4.4  
     4.5  #if HAVE_STRNCASECMP
     4.6  #define SDL_strncasecmp strncasecmp
     4.7 +#elif HAVE__STRNICMP
     4.8 +#define SDL_strncasecmp _strnicmp
     4.9  #else
    4.10  extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
    4.11  #endif
     5.1 --- a/src/stdlib/SDL_string.c	Mon Mar 13 02:12:15 2006 +0000
     5.2 +++ b/src/stdlib/SDL_string.c	Mon Mar 13 02:12:39 2006 +0000
     5.3 @@ -678,7 +678,7 @@
     5.4  }
     5.5  #endif
     5.6  
     5.7 -#ifndef HAVE_STRNCASECMP
     5.8 +#if !defined(HAVE_STRNCASECMP) && !defined(HAVE__STRNICMP)
     5.9  int SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen)
    5.10  {
    5.11      char a = 0;