[cig-commits] r5135 - in long/3D/Gale/trunk/src/StGermain: . Base/Foundation/src

walter at geodynamics.org walter at geodynamics.org
Tue Oct 31 13:28:13 PST 2006


Author: walter
Date: 2006-10-31 13:28:13 -0800 (Tue, 31 Oct 2006)
New Revision: 5135

Modified:
   long/3D/Gale/trunk/src/StGermain/
   long/3D/Gale/trunk/src/StGermain/Base/Foundation/src/shortcuts.h
Log:
 r3121 at earth:  boo | 2006-10-31 13:26:14 -0800
  r3099 at earth (orig r3876):  LukeHodkinson | 2006-10-24 20:18:42 -0700
  Adding a modification of the C assert macro that
  will leave the expression to be tested intact 
  when NDEBUG is enabled, so now we can do the
  following:
  
  insist( var = func() );
  
  with NDEBUG switched off we get:
  
  assert( var = func() );
  
  with NDEBUG on we get:
  
  var = func();
  
  Will hopefully put a stop to future problems
  involving assert statements eliminating
  code in optimised mode!
  
  
 



Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
   - 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3120
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3875
   + 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3121
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3876

Modified: long/3D/Gale/trunk/src/StGermain/Base/Foundation/src/shortcuts.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/Foundation/src/shortcuts.h	2006-10-31 21:28:09 UTC (rev 5134)
+++ long/3D/Gale/trunk/src/StGermain/Base/Foundation/src/shortcuts.h	2006-10-31 21:28:13 UTC (rev 5135)
@@ -120,5 +120,12 @@
 
 #define KillObject( obj ) \
 	if( obj ) (Stg_Class_Delete( obj ), (obj) = NULL)
+
+
+#ifndef NDEBUG
+#define insist( expr ) assert( expr )
+#else
+#define insist( expt ) expr
+#endif
 	
 #endif /* __Base_Foundation_shortcuts_h__ */



More information about the cig-commits mailing list