Skip to content

Commit

Permalink
Win32 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 13, 2006
1 parent ab8114b commit 22a2826
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion configure.in
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/SDL_config.h.in
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions include/SDL_config_win32.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/SDL_stdinc.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/stdlib/SDL_iconv.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/stdlib/SDL_string.c
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/video/wincommon/SDL_syswm.c
Expand Up @@ -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
Expand Down

0 comments on commit 22a2826

Please sign in to comment.