[PATCH v2] build/eal: add OS defines for C conditional checks
Thomas Monjalon
thomas at monjalon.net
Mon Jan 17 19:20:07 CET 2022
16/12/2021 16:21, Bruce Richardson:
> Define a set of macros in the build configuration to allow C runtime
> code to check the current OS environment. This saves the user having to
> use ifdefs for e.g. disabling particular tests on Windows. See included
> documentation changes for usage examples.
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
> Acked-by: Jerin Jacob <jerinj at marvell.com>
>
> ---
> V2: Included feedback from Dmitry to expand on documentation to include
> guidelines on when to use conditional compilation.
> ---
[...]
> +* If the code in question cannot compile on all systems, but constitutes only a small fragment of
> + a file, then conditional complication should be used, as described in this section.
complication -> compilation
[...]
> + switch (RTE_EXEC_ENV) {
> + case RTE_ENV_FREEBSD:
> + default = x;
> + break;
> + case RTE_ENV_LINUX:
> + default = y;
> + break;
> + case RTE_ENV_WINDOWS:
> + default = z;
> + break;
> + }
This is not the recommended indentation.
Applied with minor changes, thanks.
More information about the dev
mailing list