From 22a28261b0de7856863eb91e3d0c022e3af828f1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 13 Mar 2006 02:06:33 +0000 Subject: [PATCH] Win32 fixes --- configure.in | 2 +- include/SDL_config.h.in | 2 +- include/SDL_config_win32.h | 3 +-- include/SDL_stdinc.h | 4 ++-- src/stdlib/SDL_iconv.c | 4 ++-- src/stdlib/SDL_string.c | 2 +- src/video/wincommon/SDL_syswm.c | 4 ++-- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/configure.in b/configure.in index 65ae93818..cbc24c63c 100644 --- a/configure.in +++ b/configure.in @@ -116,7 +116,7 @@ if test x$enable_libc = xyes; then if test x$ac_cv_func_strtod = xyes; then AC_DEFINE(HAVE_STRTOD) fi - 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) + 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) AC_CHECK_LIB(m, pow, [BUILD_LDFLAGS="$BUILD_LDFLAGS -lm"]) fi diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 40e4fa88e..9d6ac89d1 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -117,7 +117,7 @@ #undef HAVE_ATOF #undef HAVE_STRCMP #undef HAVE_STRNCMP -#undef HAVE_STRICMP +#undef HAVE__STRICMP #undef HAVE_STRCASECMP #undef HAVE_STRNCASECMP #undef HAVE_SSCANF diff --git a/include/SDL_config_win32.h b/include/SDL_config_win32.h index 3c38b2468..dd25d7d0e 100644 --- a/include/SDL_config_win32.h +++ b/include/SDL_config_win32.h @@ -102,8 +102,7 @@ typedef unsigned int uintptr_t; #define HAVE_ATOF 1 #define HAVE_STRCMP 1 #define HAVE_STRNCMP 1 -#define HAVE_STRICMP 1 -#define HAVE_STRCASECMP 1 +#define HAVE__STRICMP 1 #define HAVE_SSCANF 1 #else #define HAVE_STDARG_H 1 diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index 5a24eb7b3..7aaae3a42 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -515,8 +515,8 @@ extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size #if HAVE_STRCASECMP #define SDL_strcasecmp strcasecmp -#elif HAVE_STRICMP -#define SDL_strcasecmp stricmp +#elif HAVE__STRICMP +#define SDL_strcasecmp _stricmp #else extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); #endif diff --git a/src/stdlib/SDL_iconv.c b/src/stdlib/SDL_iconv.c index f9f116cb5..8ab7bd01d 100644 --- a/src/stdlib/SDL_iconv.c +++ b/src/stdlib/SDL_iconv.c @@ -401,7 +401,7 @@ size_t SDL_iconv(SDL_iconv_t cd, if ( srclen < 2 ) { return SDL_ICONV_EINVAL; } - p = src; + p = (Uint8 *)src; W2 = ((Uint32)p[0] << 8) | (Uint32)p[1]; src += 2; @@ -442,7 +442,7 @@ size_t SDL_iconv(SDL_iconv_t cd, if ( srclen < 2 ) { return SDL_ICONV_EINVAL; } - p = src; + p = (Uint8 *)src; W2 = ((Uint32)p[1] << 8) | (Uint32)p[0]; src += 2; diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index 3c53b6dfd..120c7896a 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -661,7 +661,7 @@ int SDL_strncmp(const char *str1, const char *str2, size_t maxlen) } #endif -#if !defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP) +#if !defined(HAVE_STRCASECMP) && !defined(HAVE__STRICMP) int SDL_strcasecmp(const char *str1, const char *str2) { char a = 0; diff --git a/src/video/wincommon/SDL_syswm.c b/src/video/wincommon/SDL_syswm.c index d6db2fb92..c5ea7a864 100644 --- a/src/video/wincommon/SDL_syswm.c +++ b/src/video/wincommon/SDL_syswm.c @@ -230,11 +230,11 @@ void WIN_SetWMCaption(_THIS, const char *title, const char *icon) { #ifdef _WIN32_WCE /* WinCE uses the UNICODE version */ - LPWSTR lpszW = SDL_iconv_utf8_ucs2(title); + LPWSTR lpszW = SDL_iconv_utf8_ucs2((char *)title); SetWindowText(SDL_Window, lpszW); SDL_free(lpszW); #else - char *lpsz = SDL_iconv_utf8_latin1(title); + char *lpsz = SDL_iconv_utf8_latin1((char *)title); SetWindowText(SDL_Window, lpsz); SDL_free(lpsz); #endif