* 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
|
#ifdef _WIN32
|
||||||
using RubberBand::gettimeofday;
|
using RubberBand::gettimeofday;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MSVC__
|
||||||
using RubberBand::usleep;
|
using RubberBand::usleep;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ T *allocate(size_t count)
|
|||||||
ptr = malloc(count * sizeof(T));
|
ptr = malloc(count * sizeof(T));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef _WIN32
|
#ifdef __MSVC__
|
||||||
ptr = _aligned_malloc(count * sizeof(T), 16);
|
ptr = _aligned_malloc(count * sizeof(T), 16);
|
||||||
#else
|
#else
|
||||||
// Note that malloc always aligns to 16 byte boundaries on OS/X,
|
// 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>
|
template <typename T>
|
||||||
void deallocate(T *ptr)
|
void deallocate(T *ptr)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef __MSVC__
|
||||||
if (ptr) _aligned_free((void *)ptr);
|
if (ptr) _aligned_free((void *)ptr);
|
||||||
#else
|
#else
|
||||||
if (ptr) free((void *)ptr);
|
if (ptr) free((void *)ptr);
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ extern void system_specific_application_initialise();
|
|||||||
struct timeval { long tv_sec; long tv_usec; };
|
struct timeval { long tv_sec; long tv_usec; };
|
||||||
void gettimeofday(struct timeval *p, void *tz);
|
void gettimeofday(struct timeval *p, void *tz);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MSVC__
|
||||||
|
|
||||||
void usleep(unsigned long);
|
void usleep(unsigned long);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user