瀏覽代碼

fix UNKNOWN_ALLOCATOR O4

cxgeorge 24 年之前
父節點
當前提交
3d43383564
共有 3 個文件被更改,包括 11 次插入3 次删除
  1. 2 2
      dtool/Config.Win32.pp
  2. 5 1
      dtool/LocalSetup.pp
  3. 4 0
      dtool/src/dtoolbase/dtoolbase.h

+ 2 - 2
dtool/Config.Win32.pp

@@ -104,8 +104,8 @@
 // this indicates OLD_STYLE_ALLOCATOR is NOT used (defined as the empty string)
 #define OLD_STYLE_ALLOCATOR
 
-// this is reqd for msvc 7.0 to build (beta-only, havent tested final)
-// #define UNKNOWN_ALLOCATOR 1
+// this is reqd for msvc 7.0 to build (beta-only, havent tested final).  Default on for Opt4, off otherwise
+//#define USE_UNKNOWN_ALLOCATOR 1
 
 // can Intel C++ build this directory successfully (if not, change CC to msvc)
 #define NOT_INTEL_BUILDABLE false

+ 5 - 1
dtool/LocalSetup.pp

@@ -191,7 +191,11 @@ $[cdefine HAVE_RTTI]
 $[cdefine GLOBAL_OPERATOR_NEW_EXCEPTIONS]
 
 /* What style STL allocator should we declare? */
-$[cdefine UNKNOWN_ALLOCATOR]
+
+// Use this to force UNKNOWN_ALLOCATOR for non-Opt4 (it is already default for Opt4 using /DUNKNOWN_ALLOCATOR)
+// see dtoolbase.h
+$[cdefine USE_UNKNOWN_ALLOCATOR]
+
 $[cdefine OLD_STYLE_ALLOCATOR]
 $[cdefine GNU_STYLE_ALLOCATOR]
 

+ 4 - 0
dtool/src/dtoolbase/dtoolbase.h

@@ -58,6 +58,10 @@
 
 #endif  /* WIN32_VC */
 
+#if defined(USE_UNKNOWN_ALLOCATOR) && !defined(UNKNOWN_ALLOCATOR)
+#define UNKNOWN_ALLOCATOR 1
+#endif
+
 #include "dtoolsymbols.h"
 
 #ifdef HAVE_MALLOC_H