浏览代码

ifdef around my stb macro

Ron Aaron 5 年之前
父节点
当前提交
1cc9fa9619
共有 2 个文件被更改,包括 4 次插入0 次删除
  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
 #endif
 
+#ifndef STBTT_malloc
 static nk_handle fictional_handle = {0};
 
 #define STBTT_malloc(x,u)  nk_malloc( fictional_handle, 0, x ) 
 #define STBTT_free(x,u)    nk_mfree( fictional_handle , x)
+#endif
 
 #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
 #endif
 
+#ifndef STBTT_malloc
 static nk_handle fictional_handle = {0};
 
 #define STBTT_malloc(x,u)  nk_malloc( fictional_handle, 0, x ) 
 #define STBTT_free(x,u)    nk_mfree( fictional_handle , x)
+#endif
 
 #endif /* NK_NUKLEAR_H_ */