Browse Source

Fix the windows build

Panagiotis Christopoulos Charitos 8 years ago
parent
commit
c77e039152
1 changed files with 8 additions and 0 deletions
  1. 8 0
      tests/util/SparseArray.cpp

+ 8 - 0
tests/util/SparseArray.cpp

@@ -270,14 +270,18 @@ static ANKI_DONT_INLINE void* allocAlignedAk(void* userData, void* ptr, PtrSize
 {
 {
 	if(ptr == nullptr)
 	if(ptr == nullptr)
 	{
 	{
+#if ANKI_OS == ANKI_OS_LINUX
 		akAllocSize += size;
 		akAllocSize += size;
 		akMaxAllocSize = max(akMaxAllocSize, akAllocSize);
 		akMaxAllocSize = max(akMaxAllocSize, akAllocSize);
+#endif
 		return malloc(size);
 		return malloc(size);
 	}
 	}
 	else
 	else
 	{
 	{
+#if ANKI_OS == ANKI_OS_LINUX
 		PtrSize s = malloc_usable_size(ptr);
 		PtrSize s = malloc_usable_size(ptr);
 		akAllocSize -= s;
 		akAllocSize -= s;
+#endif
 		free(ptr);
 		free(ptr);
 		return nullptr;
 		return nullptr;
 	}
 	}
@@ -289,14 +293,18 @@ static ANKI_DONT_INLINE void* allocAlignedStl(void* userData, void* ptr, PtrSize
 {
 {
 	if(ptr == nullptr)
 	if(ptr == nullptr)
 	{
 	{
+#if ANKI_OS == ANKI_OS_LINUX
 		stlAllocSize += size;
 		stlAllocSize += size;
 		stlMaxAllocSize = max(stlMaxAllocSize, stlAllocSize);
 		stlMaxAllocSize = max(stlMaxAllocSize, stlAllocSize);
+#endif
 		return malloc(size);
 		return malloc(size);
 	}
 	}
 	else
 	else
 	{
 	{
+#if ANKI_OS == ANKI_OS_LINUX
 		PtrSize s = malloc_usable_size(ptr);
 		PtrSize s = malloc_usable_size(ptr);
 		stlAllocSize -= s;
 		stlAllocSize -= s;
+#endif
 		free(ptr);
 		free(ptr);
 		return nullptr;
 		return nullptr;
 	}
 	}