Moved ckprogs behind LFS_CKPROGS ifdef

So just like ckreads, ckprogs is now opt-in, requiring both 1. defining
LFS_CKPROGS at compile-time, and 2. passing the LFS_M_CKPROGS flag
during lfsr_mount.

_Unlike_ ckreads, ckprogs is actually a very lightweight feature. So the
difference between compiling with/without ckprogs is really quite small:

                code          stack
  before:      36480           2680
  yes-ckprogs: 36480 (+0.0%)   2680 (+0.0%)
  no-ckprogs:  36428 (-0.1%)   2680 (+0.0%)

It's almost not worth putting behind an ifdef if not for consistency
with ckreads.
This commit is contained in:
Christopher Haster
2024-08-12 20:01:47 -05:00
parent e536300606
commit 10feccf18c
7 changed files with 212 additions and 99 deletions
+9 -3
View File
@@ -138,10 +138,16 @@ extern "C"
// Some ifdef conveniences
#ifdef LFS_CKREADS
#define LFS_IFDEF_CKREADS(a, b) a
#ifdef LFS_CKPROGS
#define LFS_IFDEF_CKPROGS(a, b) (a)
#else
#define LFS_IFDEF_CKREADS(a, b) b
#define LFS_IFDEF_CKPROGS(a, b) (b)
#endif
#ifdef LFS_CKREADS
#define LFS_IFDEF_CKREADS(a, b) (a)
#else
#define LFS_IFDEF_CKREADS(a, b) (b)
#endif