From d03087405054955cd68a777ea0f1b7ad0a099fb4 Mon Sep 17 00:00:00 2001 From: Steffen Eiden Date: Wed, 14 Dec 2022 13:53:29 +0100 Subject: [PATCH] libpv: disallow glib features from after 2.56 Enforce that the first glib.h include is done via glib-helper.h for libpv so that glib version checks are in place. Change zdump and pvattest such that they never include glibstuff before libpv/glib-helper.h Reviewed-by: Jan Hoeppner Signed-off-by: Steffen Eiden --- include/libpv/glib-helper.h | 6 ++++++ pvattest/src/common.h | 2 +- zdump/dfi_pv_elf.c | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/libpv/glib-helper.h b/include/libpv/glib-helper.h index 5d3df50b..9f90b284 100644 --- a/include/libpv/glib-helper.h +++ b/include/libpv/glib-helper.h @@ -18,6 +18,12 @@ #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_56 #endif +#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_56 + +#ifdef __G_LIB_H__ +#error "glib.h must be included via libpv/glib-helper.h" +#endif + #include #include #include diff --git a/pvattest/src/common.h b/pvattest/src/common.h index e2e3ef14..43d2ab95 100644 --- a/pvattest/src/common.h +++ b/pvattest/src/common.h @@ -11,10 +11,10 @@ /* Must be included before any other header */ #include "config.h" -#include #include #include "libpv/glib-helper.h" +#include #include "libpv/macros.h" #include "lib/zt_common.h" diff --git a/zdump/dfi_pv_elf.c b/zdump/dfi_pv_elf.c index 8d1021e6..9d33e8f7 100644 --- a/zdump/dfi_pv_elf.c +++ b/zdump/dfi_pv_elf.c @@ -21,7 +21,6 @@ #include #include -#include #include #include