Skip to content

Commit e5e985a

Browse files
committed
Added LFS_LITTLER for disabling non-essential/debugging utils
This is a simple alias for a number of existing defines: LFS_LITTLER => LFS_NO_DEBUG LFS_NO_INFO LFS_NO_WARN LFS_NO_ERROR LFS_NO_ASSERT This is mainly to make CI/code measurements easier. I suspect most systems already make these zero (or at least minimal) cost in release mode, but when building with our Makefile we need some way to disable the simple printf/assert mapping. This probably deserves a better name, but at least this is something.
1 parent 5fe4d16 commit e5e985a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lfs_util.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@
2020
#include LFS_STRINGIZE(LFS_CONFIG)
2121
#else
2222

23+
24+
// Some convenient macro aliases
25+
// TODO move these to something like lfs_cfg.h?
26+
27+
// LFS_LITTLER disables non-essential/debugging utils
28+
//
29+
// note your system may already make these zero cost in release mode
30+
#ifdef LFS_LITTLER
31+
#define LFS_NO_DEBUG
32+
#define LFS_NO_INFO
33+
#define LFS_NO_WARN
34+
#define LFS_NO_ERROR
35+
#define LFS_NO_ASSERT
36+
#endif
37+
38+
2339
// System includes
2440
#include <stdint.h>
2541
#include <stdbool.h>

0 commit comments

Comments
 (0)