* Fix some confusions between _WIN32 (any compiler/runtime on that platform)
and __MSVC__ (VC only, not e.g. mingw32)
This commit is contained in:
@@ -41,6 +41,9 @@ using namespace RubberBand;
|
||||
|
||||
#ifdef _WIN32
|
||||
using RubberBand::gettimeofday;
|
||||
#endif
|
||||
|
||||
#ifdef __MSVC__
|
||||
using RubberBand::usleep;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ T *allocate(size_t count)
|
||||
ptr = malloc(count * sizeof(T));
|
||||
}
|
||||
#else
|
||||
#ifdef _WIN32
|
||||
#ifdef __MSVC__
|
||||
ptr = _aligned_malloc(count * sizeof(T), 16);
|
||||
#else
|
||||
// Note that malloc always aligns to 16 byte boundaries on OS/X,
|
||||
@@ -70,7 +70,7 @@ T *allocate_and_zero(size_t count)
|
||||
template <typename T>
|
||||
void deallocate(T *ptr)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#ifdef __MSVC__
|
||||
if (ptr) _aligned_free((void *)ptr);
|
||||
#else
|
||||
if (ptr) free((void *)ptr);
|
||||
|
||||
@@ -45,6 +45,10 @@ extern void system_specific_application_initialise();
|
||||
struct timeval { long tv_sec; long tv_usec; };
|
||||
void gettimeofday(struct timeval *p, void *tz);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __MSVC__
|
||||
|
||||
void usleep(unsigned long);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user