X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/0f4971d043c38bae1bfb95201622a1405110f899..63dd4f45a5b356f7f6bdc4345c7f265ac5d2cd32:/log.h?ds=sidebyside diff --git a/log.h b/log.h index 6cd16fc..818f5f2 100644 --- a/log.h +++ b/log.h @@ -4,13 +4,23 @@ * Jonathan McDowell * * Copyright 2003 Project Purple - * - * $Id: log.h,v 1.2 2003/06/04 20:57:10 noodles Exp $ */ #ifndef __LOG_H__ #define __LOG_H__ +#include + +#define log_assert(expr) \ + if (!(expr)) { \ + logthing(LOGTHING_CRITICAL, \ + "Assertion %s failed in %s, line %d", \ + #expr, \ + __FILE__, \ + __LINE__); \ + } \ + assert(expr) + /* * loglevels - levels of severity for a log entry *