Fixed implicit linkage to ftol2() on Windows

This commit is contained in:
Sam Lantinga 2020-04-13 13:24:56 -07:00
parent c302c1abb8
commit 1d8797876a
1 changed files with 5 additions and 2 deletions

View File

@ -266,8 +266,11 @@ SDL_trunc(double x)
#if defined(HAVE_TRUNC) #if defined(HAVE_TRUNC)
return trunc(x); return trunc(x);
#else #else
/* !!! FIXME: there are more formal (correct!) ways to do this. */ if (x >= 0.0f) {
return (double) ((Sint64) x); return SDL_floor(x);
} else {
return SDL_ceil(x);
}
#endif #endif
} }