Some preliminary changes needed to support building with VS2019

(these get me about as far as 'libardour' )
This commit is contained in:
John Emmas
2021-01-30 13:55:25 +00:00
parent 24e0391679
commit b496a71d2e
6 changed files with 31 additions and 19 deletions

View File

@@ -36,7 +36,7 @@
*/
#ifndef __FLOAT_CAST_H__ // Added by JE - 30-11-2009
#define __FLOAT_CAST_H__
#if (defined (WIN32) || defined (_WIN32))
#if defined (WIN32) || defined (_WIN32)
#include <math.h>

View File

@@ -47,12 +47,6 @@
#include <glib.h>
#include <ardourext/float_cast.h>
// 'std::isnan()' is not available in MSVC. Assume '_isnan(double)'
#define isnan(val) _isnan((double)val)
// 'std::isinf()' is not available in MSVC. Assume '!_finite(double)'
#define isinf(val) !_finite((double)val)
// 'INFINITY' is not defined in MSVC. Assume 'HUGE_VAL'
#ifndef INFINITY
#define INFINITY HUGE_VAL
@@ -69,6 +63,8 @@
#define X_OK 1
// Miscellaneous #defines
// JE - (these ones believed to be no longer needed from VS2015 onward)
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define __attribute__(x)
#define llabs _abs64
#define atoll _atoi64
@@ -76,9 +72,10 @@
#define getcwd _getcwd
#define getpid _getpid
#define snprintf _snprintf
#define random rand
#define link ntfs_link
#define unlink ntfs_unlink
#endif
#define random rand
#define strcasecmp stricmp
#define strncasecmp strnicmp
#define strtok_r( _s, _sep, _lasts ) \
@@ -217,10 +214,17 @@ inline int64_t abs(int64_t val) throw()
#endif
#endif
// fmin() and fmax()
// fmin() and fmax() etc.
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define fmin(a, b) __min((double)a, (double)b)
#define fmax(a, b) __max((double)a, (double)b)
// 'std::isnan()' is not available in early versions of MSVC. Assume '_isnan(double)'
#define isnan(val) _isnan((double)val)
// 'std::isinf()' is not available in early versions of MSVC. Assume '!_finite(double)'
#define isinf(val) !_finite((double)val)
#endif
// approximate POSIX pipe()