00001 /* People have been abusing assert by assuming it will always execute. To 00002 * rememdy the situation, asserts were replaced with CHECK. These should then 00003 * be manually replaced with assert (when used correctly) or UTIL_THROW (for 00004 * runtime checks). 00005 */ 00006 #ifndef UTIL_CHECK__ 00007 #define UTIL_CHECK__ 00008 00009 #include <stdlib.h> 00010 #include <iostream> 00011 00012 #include <cassert> 00013 00014 #define CHECK(Condition) do { \ 00015 if (!(Condition)) { \ 00016 std::cerr << "Check " << #Condition << " failed in " << __FILE__ << ":" << __LINE__ << std::endl; \ 00017 abort(); \ 00018 } \ 00019 } while (0) // swallow ; 00020 00021 #endif // UTIL_CHECK__