From 39dd4a8d15b1e055ee548e1e24f1eae10e9bd19b Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Tue, 28 Jan 2025 00:44:05 -0600 Subject: [PATCH] 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. --- lfs_util.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lfs_util.h b/lfs_util.h index 56f7eb44..861b42fd 100644 --- a/lfs_util.h +++ b/lfs_util.h @@ -20,6 +20,22 @@ #include LFS_STRINGIZE(LFS_CONFIG) #else + +// Some convenient macro aliases +// TODO move these to something like lfs_cfg.h? + +// LFS_LITTLER disables non-essential/debugging utils +// +// note your system may already make these zero cost in release mode +#ifdef LFS_LITTLER +#define LFS_NO_DEBUG +#define LFS_NO_INFO +#define LFS_NO_WARN +#define LFS_NO_ERROR +#define LFS_NO_ASSERT +#endif + + // System includes #include #include