Fixed Visual C++ build

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403494
This commit is contained in:
Sam Lantinga 2009-01-12 08:46:28 +00:00
parent 9116448bf3
commit e43f6d619e
10 changed files with 404 additions and 399 deletions

View File

@ -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_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_FUNCS(iconv)

View File

@ -130,6 +130,7 @@
#undef HAVE_SNPRINTF
#undef HAVE_VSNPRINTF
#undef HAVE_M_PI
#undef HAVE_CEIL
#undef HAVE_COPYSIGN
#undef HAVE_COS
#undef HAVE_COSF

View File

@ -117,6 +117,7 @@ typedef unsigned int uintptr_t;
#define HAVE__STRNICMP 1
#define HAVE_SSCANF 1
#define HAVE_M_PI 1
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1

View File

@ -646,6 +646,12 @@ extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen,
#define M_PI 3.14159265358979323846264338327950288 /* pi */
#endif
#ifdef HAVE_CEIL
#define SDL_ceil ceil
#else
#define SDL_ceil(x) ((double)(int)((x)+0.5))
#endif
#ifdef HAVE_COPYSIGN
#define SDL_copysign copysign
#else

View File

@ -478,7 +478,6 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
{
SDL_DisplayMode desktop_mode;
SDL_DisplayMode mode;
const char *env;
int window_x = SDL_WINDOWPOS_UNDEFINED;
int window_y = SDL_WINDOWPOS_UNDEFINED;
Uint32 window_flags;

View File

@ -347,7 +347,6 @@ SDL_RunAudio(void *devicep)
void *udata;
void (SDLCALL * fill) (void *userdata, Uint8 * stream, int len);
int silence;
int stream_max_len;
/* For streaming when the buffer sizes don't match up */
Uint8 *istream;

View File

@ -937,7 +937,7 @@ SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, int dst_channels,
cvt->filters[cvt->filter_index++] = filter;
if (src_rate < dst_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;
} else {
cvt->len_ratio /= ((double) src_rate) / ((double) dst_rate);

File diff suppressed because it is too large Load Diff

View File

@ -216,7 +216,7 @@ ${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format)
const $srctype *src;
$tctype *dst;
#ifdef DEBUG_CONVERT
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_${from} to AUDIO_${to}.\\n");
#endif
@ -391,7 +391,7 @@ sub buildArbitraryResampleFunc {
static void SDLCALL
${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);
#endif
@ -529,7 +529,7 @@ sub buildMultipleResampleFunc {
static void SDLCALL
${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format)
{
#ifdef DEBUG_CONVERT
#if DEBUG_CONVERT
fprintf(stderr, "$resample (x${multiple}) AUDIO_${from}, ${channels} channels.\\n");
#endif

View File

@ -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 */
if ((wParam & 0xFFF0) == SC_SCREENSAVE ||
(wParam & 0xFFF0) == SC_MONITORPOWER) {
SDL_VideoData *videodata = data->videodata;
if (videodata->suspend_screensaver) {
if (SDL_GetVideoDevice()->suspend_screensaver) {
return (0);
}
}