X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Flib.h;h=c1709ea21a32b05c8d453b89a6946d6dc2906450;hb=3f29125f27f7ee82281e49fef16ad32811cc3dcc;hp=e2bc3ef434cf34a166175ba2e085eeab6393b160;hpb=34289767d57bb8845699c819362d286bd51c8952;p=libucw.git diff --git a/lib/lib.h b/lib/lib.h index e2bc3ef4..c1709ea2 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -2,6 +2,9 @@ * Sherlock Library -- Miscellaneous Functions * * (c) 1997--2001 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ /* @@ -52,9 +55,11 @@ void log_file(byte *); void log_fork(void); #ifdef DEBUG -#define ASSERT(x) do { if (!(x)) die("Assertion `%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0) +void assert_failed(char *assertion, char *file, int line) NONRET; +#define ASSERT(x) do { if (!(x)) assert_failed(#x, __FILE__, __LINE__); } while(0) #else -#define ASSERT(x) do { } while(0) +void assert_failed(void) NONRET; +#define ASSERT(x) do { if (__builtin_constant_p(x) && !(x)) assert_failed(); } while(0) #endif #ifdef LOCAL_DEBUG