Skip to content

Commit 55a9411

Browse files
committed
Avoid MOD_ASSERT spamming.
1 parent 4bc5a2d commit 55a9411

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Lib/module_priv.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#include <stdlib.h>
22
#include "map.h"
33

4-
#define MOD_ASSERT(cond, msg, ret) if(!cond) { fprintf(stderr, "%s\n", msg); return ret; }
4+
#ifndef NDEBUG
5+
#define MOD_ASSERT(cond, msg, ret) if (!cond) { fprintf(stderr, "%s\n", msg); return ret; }
6+
#else
7+
#define MOD_ASSERT(cond, msg, ret) if (!cond) { return ret; }
8+
#endif
59

610
#ifndef NDEBUG
711
#define MODULE_DEBUG printf("Libmodule: "); printf

TODO.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [x] add a module_broadcast function
1111
- [x] map_put to take additional "bool key_strdup" param
1212
- [x] Add a map_has_key function + use it where needed
13+
- [x] Avoid MOD_ASSERT spamming in release mode
1314

1415
### Fixes
1516
- [x] Move call to "destroy()" callback after module and self_t destruction; this way no more libmodule things can be called on that being-destroyed module

0 commit comments

Comments
 (0)