Add a note regarding use of #if for config.h processing.

This commit is contained in:
Milan Broz
2025-01-27 10:40:09 +01:00
parent c6a7849090
commit 06c0f03c9f

View File

@@ -127,7 +127,8 @@ Cryptsetup uses [Linux kernel coding style](https://www.kernel.org/doc/html/late
- Use an elaborative description in the patch header.
- No need to use sign-off-by lines.
- Use name prefixes (``crypt_``, ``LUKS2_`` and similar).
- Avoid extensive preprocessor use (specifically ``#ifdef`` sections).
- Avoid extensive preprocessor use (specifically conditional ``#if`` or ``#ifdef`` sections).
- To check detected configuration options stored in config.h, always use ``#if SOMETHING`` (do NOT use ``#ifdef``).
- Use output only through ``log_err, log_std, log_verbose, log_dbg`` macros.
The ``log_dbg`` is always in English; the others should be wrapped in the ``_()`` macro for translation.
- Use ``assert()`` but only for simple invariants and variables (avoid calling functions).