Commit e43f6d61 authored by Sam Lantinga's avatar Sam Lantinga

Fixed Visual C++ build

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403494
parent 9116448b
...@@ -152,7 +152,7 @@ if test x$enable_libc = xyes; then ...@@ -152,7 +152,7 @@ if test x$enable_libc = xyes; then
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 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 _strnicmp strncasecmp sscanf snprintf vsnprintf sigaction setjmp nanosleep)
AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"]) AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
AC_CHECK_FUNCS(copysign cos cosf fabs floor log pow scalbn sin sinf sqrt) AC_CHECK_FUNCS(ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt)
AC_CHECK_LIB(iconv, libiconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"]) AC_CHECK_LIB(iconv, libiconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
AC_CHECK_FUNCS(iconv) AC_CHECK_FUNCS(iconv)
......
...@@ -130,6 +130,7 @@ ...@@ -130,6 +130,7 @@
#undef HAVE_SNPRINTF #undef HAVE_SNPRINTF
#undef HAVE_VSNPRINTF #undef HAVE_VSNPRINTF
#undef HAVE_M_PI #undef HAVE_M_PI
#undef HAVE_CEIL
#undef HAVE_COPYSIGN #undef HAVE_COPYSIGN
#undef HAVE_COS #undef HAVE_COS
#undef HAVE_COSF #undef HAVE_COSF
......
...@@ -117,6 +117,7 @@ typedef unsigned int uintptr_t; ...@@ -117,6 +117,7 @@ typedef unsigned int uintptr_t;
#define HAVE__STRNICMP 1 #define HAVE__STRNICMP 1
#define HAVE_SSCANF 1 #define HAVE_SSCANF 1
#define HAVE_M_PI 1 #define HAVE_M_PI 1
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 1 #define HAVE_COPYSIGN 1
#define HAVE_COS 1 #define HAVE_COS 1
#define HAVE_COSF 1 #define HAVE_COSF 1
......
...@@ -646,6 +646,12 @@ extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, ...@@ -646,6 +646,12 @@ extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen,
#define M_PI 3.14159265358979323846264338327950288 /* pi */ #define M_PI 3.14159265358979323846264338327950288 /* pi */
#endif #endif
#ifdef HAVE_CEIL
#define SDL_ceil ceil
#else
#define SDL_ceil(x) ((double)(int)((x)+0.5))
#endif
#ifdef HAVE_COPYSIGN #ifdef HAVE_COPYSIGN
#define SDL_copysign copysign #define SDL_copysign copysign
#else #else
......
...@@ -478,7 +478,6 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags) ...@@ -478,7 +478,6 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
{ {
SDL_DisplayMode desktop_mode; SDL_DisplayMode desktop_mode;
SDL_DisplayMode mode; SDL_DisplayMode mode;
const char *env;
int window_x = SDL_WINDOWPOS_UNDEFINED; int window_x = SDL_WINDOWPOS_UNDEFINED;
int window_y = SDL_WINDOWPOS_UNDEFINED; int window_y = SDL_WINDOWPOS_UNDEFINED;
Uint32 window_flags; Uint32 window_flags;
......
...@@ -347,7 +347,6 @@ SDL_RunAudio(void *devicep) ...@@ -347,7 +347,6 @@ SDL_RunAudio(void *devicep)
void *udata; void *udata;
void (SDLCALL * fill) (void *userdata, Uint8 * stream, int len); void (SDLCALL * fill) (void *userdata, Uint8 * stream, int len);
int silence; int silence;
int stream_max_len;
/* For streaming when the buffer sizes don't match up */ /* For streaming when the buffer sizes don't match up */
Uint8 *istream; Uint8 *istream;
......
...@@ -937,7 +937,7 @@ SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, int dst_channels, ...@@ -937,7 +937,7 @@ SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, int dst_channels,
cvt->filters[cvt->filter_index++] = filter; cvt->filters[cvt->filter_index++] = filter;
if (src_rate < dst_rate) { if (src_rate < dst_rate) {
const double mult = ((double) dst_rate) / ((double) src_rate); const double mult = ((double) dst_rate) / ((double) src_rate);
cvt->len_mult *= (int) ceil(mult); /* !!! FIXME: C runtime dependency. */ cvt->len_mult *= (int) SDL_ceil(mult);
cvt->len_ratio *= mult; cvt->len_ratio *= mult;
} else { } else {
cvt->len_ratio /= ((double) src_rate) / ((double) dst_rate); cvt->len_ratio /= ((double) src_rate) / ((double) dst_rate);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -216,7 +216,7 @@ ${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format) ...@@ -216,7 +216,7 @@ ${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format)
const $srctype *src; const $srctype *src;
$tctype *dst; $tctype *dst;
#ifdef DEBUG_CONVERT #if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_${from} to AUDIO_${to}.\\n"); fprintf(stderr, "Converting AUDIO_${from} to AUDIO_${to}.\\n");
#endif #endif
...@@ -391,7 +391,7 @@ sub buildArbitraryResampleFunc { ...@@ -391,7 +391,7 @@ sub buildArbitraryResampleFunc {
static void SDLCALL static void SDLCALL
${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format) ${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format)
{ {
#ifdef DEBUG_CONVERT #if DEBUG_CONVERT
fprintf(stderr, "$resample arbitrary (x%f) AUDIO_${from}, ${channels} channels.\\n", cvt->rate_incr); fprintf(stderr, "$resample arbitrary (x%f) AUDIO_${from}, ${channels} channels.\\n", cvt->rate_incr);
#endif #endif
...@@ -529,7 +529,7 @@ sub buildMultipleResampleFunc { ...@@ -529,7 +529,7 @@ sub buildMultipleResampleFunc {
static void SDLCALL static void SDLCALL
${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format) ${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format)
{ {
#ifdef DEBUG_CONVERT #if DEBUG_CONVERT
fprintf(stderr, "$resample (x${multiple}) AUDIO_${from}, ${channels} channels.\\n"); fprintf(stderr, "$resample (x${multiple}) AUDIO_${from}, ${channels} channels.\\n");
#endif #endif
......
...@@ -578,8 +578,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -578,8 +578,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
/* Don't start the screensaver or blank the monitor in fullscreen apps */ /* Don't start the screensaver or blank the monitor in fullscreen apps */
if ((wParam & 0xFFF0) == SC_SCREENSAVE || if ((wParam & 0xFFF0) == SC_SCREENSAVE ||
(wParam & 0xFFF0) == SC_MONITORPOWER) { (wParam & 0xFFF0) == SC_MONITORPOWER) {
SDL_VideoData *videodata = data->videodata; if (SDL_GetVideoDevice()->suspend_screensaver) {
if (videodata->suspend_screensaver) {
return (0); return (0);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment