[commit] r2436 - trunk/GME/Mga

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Tue Feb 18 16:29:31 CST 2014


Author: ksmyth
Date: Tue Feb 18 16:29:31 2014
New Revision: 2436

Log:
ASSERT for Release mode, since Debug heap takes forever

Modified:
   trunk/GME/Mga/StdAfx.h

Modified: trunk/GME/Mga/StdAfx.h
==============================================================================
--- trunk/GME/Mga/StdAfx.h	Tue Feb 18 16:29:23 2014	(r2435)
+++ trunk/GME/Mga/StdAfx.h	Tue Feb 18 16:29:31 2014	(r2436)
@@ -74,7 +74,22 @@
 #define INTERFACECOLL_INCLUDED
 // End Imports
 
+#if 1
 #define ASSERT ATLASSERT
+#else
+static int _MgaDbgReportW(const wchar_t* file, __int64 line, const wchar_t* msg)
+{
+	wchar_t message[1024 * 2];
+	swprintf_s(message, L"Assert failed at %s:%I64d\n\nExpression: %s\n\nPress Ok to debug.", file, line, msg);
+	return ::MessageBox(0, message, L"Assert failed", MB_OKCANCEL);
+}
+
+#define _MGAASSERTE(expr, msg) \
+        (void) ((!!(expr)) || \
+                (IDOK == _MgaDbgReportW(_CRT_WIDE(__FILE__), __LINE__, msg)) && (DebugBreak(), 0))
+#define ASSERT(expr)  _MGAASSERTE((expr), _CRT_WIDE(#expr))
+
+#endif
 #include "CommonSmart.h"
 #include "CommonStl.h"
 #include "CommonError.h"


More information about the gme-commit mailing list