Mercurial > hg > dmlib
diff src/dmlib.h @ 1046:7e54b2d08ce7
Add special debug error message function/macro that can be
disabled and compiled out.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 01 Mar 2015 18:03:08 +0200 |
parents | 43594ac98f91 |
children | b6c5e0c62588 |
line wrap: on
line diff
--- a/src/dmlib.h Sun Mar 01 17:47:50 2015 +0200 +++ b/src/dmlib.h Sun Mar 01 18:03:08 2015 +0200 @@ -21,6 +21,7 @@ # define assert(NEXPR) // stub #endif + #ifdef __cplusplus extern "C" { #endif @@ -331,6 +332,12 @@ int dmGetErrno(); const char *dmErrorStr(const int error); +#ifdef DM_DEBUG +# define dmErrorDBG dmError +#else +# define dmErrorDBG(ecode, fmt, ...) (ecode) // Dummy +#endif + void * dmMalloc(size_t); void * dmMalloc0(size_t); void * dmRealloc(void *, size_t);