Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed Visual C++ build
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 12, 2009
1 parent c5765dd commit 29927bc
Show file tree
Hide file tree
Showing 10 changed files with 404 additions and 399 deletions.
2 changes: 1 addition & 1 deletion configure.in
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config.h.in
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config_win32.h
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions include/SDL_stdinc.h
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/SDL_compat.c
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/audio/SDL_audio.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/audio/SDL_audiocvt.c
Expand Up @@ -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);
Expand Down

0 comments on commit 29927bc

Please sign in to comment.