Replace __MSVC__ define (which needs to be defined manually in the build) with _MSC_VER (which the compiler defines itself) throughout

This commit is contained in:
Chris Cannam
2020-12-10 09:25:28 +00:00
parent 3297cfab0c
commit 16487324fc
4 changed files with 10 additions and 10 deletions

View File

@@ -35,7 +35,7 @@
#include "system/sysutils.h" #include "system/sysutils.h"
#ifdef __MSVC__ #ifdef _MSC_VER
#include "getopt/getopt.h" #include "getopt/getopt.h"
#else #else
#include <getopt.h> #include <getopt.h>
@@ -52,7 +52,7 @@ using namespace RubberBand;
using RubberBand::gettimeofday; using RubberBand::gettimeofday;
#endif #endif
#ifdef __MSVC__ #ifdef _MSC_VER
using RubberBand::usleep; using RubberBand::usleep;
#endif #endif

View File

@@ -30,7 +30,7 @@
#include <stdio.h> #include <stdio.h>
#ifdef __MSVC__ #ifdef _MSC_VER
// Ugh --cc // Ugh --cc
#define snprintf sprintf_s #define snprintf sprintf_s
#endif #endif

View File

@@ -237,7 +237,7 @@ system_get_process_status(int pid)
#ifdef _WIN32 #ifdef _WIN32
void system_memorybarrier() void system_memorybarrier()
{ {
#ifdef __MSVC__ #ifdef _MSC_VER
MemoryBarrier(); MemoryBarrier();
#else /* (mingw) */ #else /* (mingw) */
LONG Barrier = 0; LONG Barrier = 0;

View File

@@ -24,7 +24,7 @@
#ifndef _RUBBERBAND_SYSUTILS_H_ #ifndef _RUBBERBAND_SYSUTILS_H_
#define _RUBBERBAND_SYSUTILS_H_ #define _RUBBERBAND_SYSUTILS_H_
#ifdef __MSVC__ #ifdef _MSC_VER
# if _MSC_VER < 1800 # if _MSC_VER < 1800
# include "float_cast/float_cast.h" # include "float_cast/float_cast.h"
# endif # endif
@@ -43,7 +43,7 @@
# define R__ # define R__
#endif #endif
#if defined(__MSVC__) #if defined(_MSC_VER)
# include <malloc.h> # include <malloc.h>
# include <process.h> # include <process.h>
# define alloca _alloca # define alloca _alloca
@@ -65,11 +65,11 @@
# endif # endif
#endif #endif
#if defined(__MSVC__) && _MSC_VER < 1700 #if defined(_MSC_VER) && _MSC_VER < 1700
# define uint8_t unsigned __int8 # define uint8_t unsigned __int8
# define uint16_t unsigned __int16 # define uint16_t unsigned __int16
# define uint32_t unsigned __int32 # define uint32_t unsigned __int32
#elif defined(__MSVC__) #elif defined(_MSC_VER)
# define ssize_t long # define ssize_t long
# include <stdint.h> # include <stdint.h>
#else #else
@@ -93,9 +93,9 @@ struct timeval { long tv_sec; long tv_usec; };
void gettimeofday(struct timeval *p, void *tz); void gettimeofday(struct timeval *p, void *tz);
#endif // _WIN32 #endif // _WIN32
#ifdef __MSVC__ #ifdef _MSC_VER
void usleep(unsigned long); void usleep(unsigned long);
#endif // __MSVC__ #endif // _MSC_VER
inline double mod(double x, double y) { return x - (y * floor(x / y)); } inline double mod(double x, double y) { return x - (y * floor(x / y)); }
inline float modf(float x, float y) { return x - (y * float(floor(x / y))); } inline float modf(float x, float y) { return x - (y * float(floor(x / y))); }