Quellcode durchsuchen

Merge pull request #1 from mendsley/master

Updating bgfx to use new tinystl allocator macro
Branimir Karadžić vor 13 Jahren
Ursprung
Commit
d3ef0e407a
2 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen
  1. 2 2
      src/bgfx.cpp
  2. 3 2
      src/bgfx_p.h

+ 2 - 2
src/bgfx.cpp

@@ -12,12 +12,12 @@ HWND g_bgfxHwnd = NULL;
 #if BGFX_CONFIG_USE_TINYSTL
 #if BGFX_CONFIG_USE_TINYSTL
 namespace tinystl
 namespace tinystl
 {
 {
-	void* allocator::static_allocate(size_t _bytes)
+	void* bgfx_allocator::static_allocate(size_t _bytes)
 	{
 	{
 		return bgfx::g_realloc(NULL, _bytes);
 		return bgfx::g_realloc(NULL, _bytes);
 	}
 	}
 
 
-	void allocator::static_deallocate(void* _ptr, size_t /*_bytes*/)
+	void bgfx_allocator::static_deallocate(void* _ptr, size_t /*_bytes*/)
 	{
 	{
 		bgfx::g_free(_ptr);
 		bgfx::g_free(_ptr);
 	}
 	}

+ 3 - 2
src/bgfx_p.h

@@ -79,15 +79,16 @@ extern HWND g_bgfxHwnd;
 #define BGFX_MAGIC MAKEFOURCC('B','G','F','X')
 #define BGFX_MAGIC MAKEFOURCC('B','G','F','X')
 
 
 #if BGFX_CONFIG_USE_TINYSTL
 #if BGFX_CONFIG_USE_TINYSTL
+
 namespace tinystl
 namespace tinystl
 {
 {
-	struct allocator
+	struct bgfx_allocator
 	{
 	{
 		static void* static_allocate(size_t _bytes);
 		static void* static_allocate(size_t _bytes);
 		static void static_deallocate(void* _ptr, size_t /*_bytes*/);
 		static void static_deallocate(void* _ptr, size_t /*_bytes*/);
 	};
 	};
 } // namespace tinystl
 } // namespace tinystl
-#	define TINYSTL_ALLOCATOR_H
+#	define TINYSTL_ALLOCATOR tinystl::bgfx_allocator
 
 
 #	include <TINYSTL/string.h>
 #	include <TINYSTL/string.h>
 #	include <TINYSTL/unordered_map.h>
 #	include <TINYSTL/unordered_map.h>