Browse Source

[c] Fixed KMemory and test harness for GCC on Linux.

badlogic 8 years ago
parent
commit
3dbab2122d

+ 5 - 5
spine-c/spine-c-unit-tests/main.cpp

@@ -22,11 +22,11 @@ void RegisterMemoryLeakDetector()
 {
 	// Register our malloc and free functions to track memory leaks
 	#ifdef KANJI_MEMTRACE
-	_setDebugMalloc(_kanjimalloc);
+	_spSetDebugMalloc(_kanjimalloc);
 	#endif
-	_setMalloc(_kanjimalloc);
-	_setRealloc(_kanjirealloc);
-	_setFree(_kanjifree);
+	_spSetMalloc(_kanjimalloc);
+	_spSetRealloc(_kanjirealloc);
+	_spSetFree(_kanjifree);
 }
 
 int main(int argc, char* argv[])
@@ -74,6 +74,6 @@ extern "C" { // probably unnecessary
 	}
 
 	char* _spUtil_readFile(const char* path, int* length) {
-		return _readFile(path, length);
+		return _spReadFile(path, length);
 	}
 }

+ 2 - 2
spine-c/spine-c-unit-tests/memory/KMemory.cpp

@@ -30,7 +30,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 // Our memory system is thread-safe, but instead of linking massive libraries,
 // we attempt to use C++11 std::mutex.
-#ifdef USE_CPP11_MUTEX
+#ifdef USE_CPP11_MUTEX_DISABLED
 #include <mutex>
 typedef std::recursive_mutex KSysLock; // rentrant
 struct KAutoLock {
@@ -300,4 +300,4 @@ size_t KMemoryAllocated()
         size += info.size;
     }
     return size;
-}
+}