mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
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:
@@ -117,7 +117,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined _MSC_VER
|
#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 */
|
/* Visual Studio 2010 has decent C99 support */
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
# define PRIu64 "llu"
|
# define PRIu64 "llu"
|
||||||
|
|||||||
@@ -51,15 +51,14 @@
|
|||||||
|
|
||||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||||
|
|
||||||
#if !defined(HAVE_LROUND)
|
#if defined(_MSC_VER) && (_MSC_VER < 1800)
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#define copysign _copysign
|
|
||||||
#elif defined(__GNUC__)
|
|
||||||
#define copysign __builtin_copysign
|
|
||||||
#endif
|
|
||||||
static inline long int lround(double x) {
|
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... */
|
/* If this fails, we are in the presence of a mid 90's compiler, move along... */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user