Browse Source

ifdef around my stb macro

Ron Aaron 5 years ago
parent
commit
1cc9fa9619
2 changed files with 4 additions and 0 deletions
  1. 2 0
      nuklear.h
  2. 2 0
      src/nuklear.h

+ 2 - 0
nuklear.h

@@ -5685,10 +5685,12 @@ template<typename T> struct nk_alignof{struct Big {T x; char c;}; enum {
 #define STB_TRUETYPE_IMPLEMENTATION
 #define STB_TRUETYPE_IMPLEMENTATION
 #endif
 #endif
 
 
+#ifndef STBTT_malloc
 static nk_handle fictional_handle = {0};
 static nk_handle fictional_handle = {0};
 
 
 #define STBTT_malloc(x,u)  nk_malloc( fictional_handle, 0, x ) 
 #define STBTT_malloc(x,u)  nk_malloc( fictional_handle, 0, x ) 
 #define STBTT_free(x,u)    nk_mfree( fictional_handle , x)
 #define STBTT_free(x,u)    nk_mfree( fictional_handle , x)
+#endif
 
 
 #endif /* NK_NUKLEAR_H_ */
 #endif /* NK_NUKLEAR_H_ */
 
 

+ 2 - 0
src/nuklear.h

@@ -5466,9 +5466,11 @@ template<typename T> struct nk_alignof{struct Big {T x; char c;}; enum {
 #define STB_TRUETYPE_IMPLEMENTATION
 #define STB_TRUETYPE_IMPLEMENTATION
 #endif
 #endif
 
 
+#ifndef STBTT_malloc
 static nk_handle fictional_handle = {0};
 static nk_handle fictional_handle = {0};
 
 
 #define STBTT_malloc(x,u)  nk_malloc( fictional_handle, 0, x ) 
 #define STBTT_malloc(x,u)  nk_malloc( fictional_handle, 0, x ) 
 #define STBTT_free(x,u)    nk_mfree( fictional_handle , x)
 #define STBTT_free(x,u)    nk_mfree( fictional_handle , x)
+#endif
 
 
 #endif /* NK_NUKLEAR_H_ */
 #endif /* NK_NUKLEAR_H_ */