diff --git a/examples/common/common.h b/examples/common/common.h index 0f2a4a1d..3e80ee67 100644 --- a/examples/common/common.h +++ b/examples/common/common.h @@ -11,18 +11,4 @@ #include "entry/entry.h" -// For a custom tinystl allocator, define this and implement TinyStlCustomAllocator somewhere in the project. -#ifndef COMMON_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR -# define COMMON_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR 0 -#endif // COMMON_CONFIG_USE_TINYSTL - -#if COMMON_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR -struct TinyStlCustomAllocator -{ - static void* static_allocate(size_t _bytes); - static void static_deallocate(void* _ptr, size_t /*_bytes*/); -}; -# define TINYSTL_ALLOCATOR TinyStlCustomAllocator -#endif //COMMON_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR - #endif // COMMON_H_HEADER_GUARD diff --git a/examples/common/entry/cmd.cpp b/examples/common/entry/cmd.cpp index 7464176d..bbe5a9a6 100644 --- a/examples/common/entry/cmd.cpp +++ b/examples/common/entry/cmd.cpp @@ -10,9 +10,9 @@ #include #include -#include "../common.h" #include "dbg.h" #include "cmd.h" +#include "entry.h" //TinyStlCustomAllocator #include #include diff --git a/examples/common/entry/entry.h b/examples/common/entry/entry.h index 7f6524b8..0c92440d 100644 --- a/examples/common/entry/entry.h +++ b/examples/common/entry/entry.h @@ -18,6 +18,20 @@ extern "C" int _main_(int _argc, char** _argv); #define ENTRY_WINDOW_FLAG_ASPECT_RATIO UINT32_C(0x00000001) #define ENTRY_WINDOW_FLAG_FRAME UINT32_C(0x00000002) +// For a custom tinystl allocator, define this and implement TinyStlCustomAllocator somewhere in the project. +#ifndef ENTRY_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR +# define ENTRY_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR 0 +#endif // ENTRY_CONFIG_USE_TINYSTL + +#if ENTRY_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR + struct TinyStlCustomAllocator + { + static void* static_allocate(size_t _bytes); + static void static_deallocate(void* _ptr, size_t /*_bytes*/); + }; +# define TINYSTL_ALLOCATOR TinyStlCustomAllocator +#endif //ENTRY_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR + namespace entry { struct WindowHandle { uint16_t idx; }; diff --git a/examples/common/entry/entry_windows.cpp b/examples/common/entry/entry_windows.cpp index 27944129..1b3f4f2d 100644 --- a/examples/common/entry/entry_windows.cpp +++ b/examples/common/entry/entry_windows.cpp @@ -4,7 +4,6 @@ */ #include "entry_p.h" -#include "../common.h" #if ENTRY_CONFIG_USE_NATIVE && BX_PLATFORM_WINDOWS diff --git a/examples/common/entry/input.cpp b/examples/common/entry/input.cpp index ecfeb055..851f2264 100644 --- a/examples/common/entry/input.cpp +++ b/examples/common/entry/input.cpp @@ -5,7 +5,6 @@ #include -#include "../common.h" #include "entry_p.h" #include "input.h"