mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-05-11 14:38:17 +02:00
In library source files, the order of things should be: 1. Define macros that affect the behavior of system headers, such as `_POSIX_C_SOURCE` and `_GNU_SOURCE`. 2. Include the library's common header: `common.h`. It takes care of many things, including defining the library configuration, granting access to private fields in structures, and activating platform-specific hacks. 3. Possibly a few header inclusions and macro definitions. 4. Guard everything else by `#if defined(MBEDTLS_XXX_C)` or some such. Enforce this order in files that previously did things they shouldn't have before including `common.h`. To locate the potentially problematic files: ``` grep -m1 '^#' library/*.c | grep -v -F common.h ``` Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
9.2 KiB
9.2 KiB