[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH v2] include/essentials: Fix redefinition warnings when using newlib
For some macrodefinitions, newlib headers do not care if they were previously defined and this results in redefinitions compiler warnings. In some way, it makes sense to give priority to newlib's definitions if one decides to use it as a libc implementation. Therefore we include the newlib headers in essentials.h to give priority to their definitions instead of ours. Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx> --- include/uk/essentials.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/uk/essentials.h b/include/uk/essentials.h index 47e04f7c..d9b24fcb 100644 --- a/include/uk/essentials.h +++ b/include/uk/essentials.h @@ -38,6 +38,20 @@ #ifndef __UK_ESSENTIALS_H__ #define __UK_ESSENTIALS_H__ +#include <uk/config.h> + +#if CONFIG_LIBNEWLIBC +/* + * Needed for __used, __unused, __packed, __section, + * __nonnull, __offsetof, __containerof + */ +#include <sys/cdefs.h> +/* Needed for __STRINGIFY */ +#include <sys/param.h> +/* Needed for MIN, MAX */ +#include <inttypes.h> +#endif + #ifdef __cplusplus extern "C" { #endif -- 2.11.0 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |