Skip to content

Commit fe5df3c

Browse files
committed
FEAT: allow lowering assertions level using ALEVEL define
1 parent c214c22 commit fe5df3c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/include/sys-core.h

+12-4
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,23 @@ enum {
288288
#define FREE(m, s) free(m)
289289
#define ALIGN(s, a) (((s) + (a)-1) & ~((a)-1))
290290

291+
#ifndef ALEVEL
291292
#define ALEVEL 2
293+
#endif
292294

293295
#define ASSERT(c,m) if (!(c)) Crash(m); // (breakpoint in Crash() to see why)
294296
#if (ALEVEL>0)
295-
#define ASSERT1(c,m) if (!(c)) Crash(m); // Not in beta releases
296-
#if (ALEVEL>1)
297-
#define ASSERT2(c,m) if (!(c)) Crash(m); // Not in any releases
298-
#endif
297+
# define ASSERT1(c,m) if (!(c)) Crash(m); // Not in beta releases
298+
# if (ALEVEL>1)
299+
# define ASSERT2(c,m) if (!(c)) Crash(m); // Not in any releases
300+
# else
301+
# define ASSERT2
302+
# endif
303+
#else
304+
# define ASSERT1
305+
# define ASSERT2
299306
#endif
307+
300308
#define MEM_CARE 5 // Lower number for more frequent checks
301309

302310

0 commit comments

Comments
 (0)