libFLAC: Tweak MSVC support

Visual Studio 2013 and newer has better support for C99.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
This commit is contained in:
Erik de Castro Lopo
2016-01-04 10:28:49 +11:00
parent ee06cabba5
commit 0a0e5363ad
2 changed files with 9 additions and 8 deletions

View File

@@ -117,7 +117,9 @@
#endif
#if defined _MSC_VER
# if _MSC_VER >= 1600
# if _MSC_VER >= 1800
# include <inttypes.h>
# elif _MSC_VER >= 1600
/* Visual Studio 2010 has decent C99 support */
# include <stdint.h>
# define PRIu64 "llu"

View File

@@ -51,15 +51,14 @@
#ifndef FLAC__INTEGER_ONLY_LIBRARY
#if !defined(HAVE_LROUND)
#if defined(_MSC_VER)
#if defined(_MSC_VER) && (_MSC_VER < 1800)
#include <float.h>
#define copysign _copysign
#elif defined(__GNUC__)
#define copysign __builtin_copysign
#endif
static inline long int lround(double x) {
return (long)(x + copysign (0.5, x));
return (long)(x + _copysign(0.5, x));
}
#elif !defined(HAVE_LROUND) && defined(__GNUC__)
static inline long int lround(double x) {
return (long)(x + __builtin_copysign(0.5, x));
}
/* If this fails, we are in the presence of a mid 90's compiler, move along... */
#endif