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.
This commit is contained in:
Christopher Haster
2025-01-28 00:44:05 -06:00
parent bf2be23f60
commit 39dd4a8d15
+16
View File
@@ -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 <stdint.h>
#include <stdbool.h>