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 <hoeppner@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Steffen Eiden
2022-12-14 13:53:29 +01:00
parent 394a6dd5ea
commit d030874050
3 changed files with 7 additions and 2 deletions

View File

@@ -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 <glib.h>
#include <gmodule.h>
#include <stdio.h>

View File

@@ -11,10 +11,10 @@
/* Must be included before any other header */
#include "config.h"
#include <glib/gi18n.h>
#include <stdio.h>
#include "libpv/glib-helper.h"
#include <glib/gi18n.h>
#include "libpv/macros.h"
#include "lib/zt_common.h"

View File

@@ -21,7 +21,6 @@
#include <elf.h>
#include <errno.h>
#include <glib.h>
#include <openssl/bio.h>
#include <openssl/crypto.h>