0024908: Make OSD_MallocHook working under MSVS 2012
[occt.git] / src / OSD / OSD_MAllocHook.cxx
index ef54a38..be8f28e 100644 (file)
@@ -38,8 +38,13 @@ static OSD_MAllocHook::Callback* MypCurrentCallback = NULL;
 
 namespace {
   // dummy function to call at place where break point might be needed
-  inline void place_for_breakpoint () {}
-}
+  static unsigned debug_counter = 0;
+  inline void place_for_breakpoint () {
+      // this statement is just to have any instruction in object code,
+      // otherwise compiler does not leave a place for break point
+      debug_counter++;
+  }
+};
 
 //=======================================================================
 //function : GetCallback
@@ -80,7 +85,7 @@ OSD_MAllocHook::CollectBySize* OSD_MAllocHook::GetCollectBySize()
 #ifdef WNT
 #include <crtdbg.h>
 
-#if _MSC_VER == 1500  /* VS 2008 */
+#if _MSC_VER >= 1500  /* VS 2008 */
 
 static long getRequestNum(void* pvData, long lRequest, size_t& theSize)
 {
@@ -111,7 +116,7 @@ static long getRequestNum(void* pvData, long lRequest, size_t& theSize)
   return aHeader->lRequest;
 }
 
-#else /* _MSC_VER == 1500 */
+#else /* _MSC_VER < 1500 */
 
 static long getRequestNum(void* /*pvData*/, long lRequest, size_t& /*theSize*/)
 {