diff options
Diffstat (limited to 'src/sciteco.h')
-rw-r--r-- | src/sciteco.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sciteco.h b/src/sciteco.h index 87bd973..5734c57 100644 --- a/src/sciteco.h +++ b/src/sciteco.h @@ -58,6 +58,16 @@ teco_is_failure(teco_bool_t x) return x >= 0; } +/** + * Call function as destructor on debug builds. + * This should be used only if the cleanup is optional. + */ +#ifdef NDEBUG +#define TECO_DEBUG_CLEANUP __attribute__((unused)) +#else +#define TECO_DEBUG_CLEANUP __attribute__((destructor)) +#endif + /** TRUE if C is a control character */ #define TECO_IS_CTL(C) ((C) < ' ') /** ASCII character to echo control character C */ |