fix MSVC version test in src/utils.h

"_MSC_VER < 1800" passes on Linux/gcc, because gcc evaluates undefined
symbols as zero, so the version check needs to test defined(_MSC_VER)
too.
master
John Bartholomew 2014-01-07 19:49:28 +00:00
parent bf4eeed03e
commit 0248ef29d5
1 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ inline bool ends_with_ci(const std::string &s, const std::string &t) {
}
// add a few things that MSVC is missing
#if _MSC_VER < 1800
#if defined(_MSC_VER) && (_MSC_VER < 1800)
// round & roundf. taken from http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/auxiliary/util/u_math.h
static inline double round(double x)
@ -117,7 +117,7 @@ static inline float roundf(float x)
{
return x >= 0.0f ? floorf(x + 0.5f) : ceilf(x - 0.5f);
}
#endif /* _MSC_VER */
#endif /* _MSC_VER < 1800 */
static inline Uint32 ceil_pow2(Uint32 v)
{