* Fix some confusions between _WIN32 (any compiler/runtime on that platform)

and __MSVC__ (VC only, not e.g. mingw32)
This commit is contained in:
Chris Cannam
2010-05-04 11:14:26 +01:00
parent c5daafc067
commit 8b3a5e4979
3 changed files with 9 additions and 2 deletions

View File

@@ -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);

View File

@@ -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