浏览代码

Fix the windows build

Panagiotis Christopoulos Charitos 8 年之前
父节点
当前提交
c77e039152
共有 1 个文件被更改,包括 8 次插入0 次删除
  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 ANKI_OS == ANKI_OS_LINUX
 		akAllocSize += size;
 		akMaxAllocSize = max(akMaxAllocSize, akAllocSize);
+#endif
 		return malloc(size);
 	}
 	else
 	{
+#if ANKI_OS == ANKI_OS_LINUX
 		PtrSize s = malloc_usable_size(ptr);
 		akAllocSize -= s;
+#endif
 		free(ptr);
 		return nullptr;
 	}
@@ -289,14 +293,18 @@ static ANKI_DONT_INLINE void* allocAlignedStl(void* userData, void* ptr, PtrSize
 {
 	if(ptr == nullptr)
 	{
+#if ANKI_OS == ANKI_OS_LINUX
 		stlAllocSize += size;
 		stlMaxAllocSize = max(stlMaxAllocSize, stlAllocSize);
+#endif
 		return malloc(size);
 	}
 	else
 	{
+#if ANKI_OS == ANKI_OS_LINUX
 		PtrSize s = malloc_usable_size(ptr);
 		stlAllocSize -= s;
+#endif
 		free(ptr);
 		return nullptr;
 	}