From abff8be13bebf2e33ad2e7fe8d97c8b59b48ef6f Mon Sep 17 00:00:00 2001 From: hwspeedy Date: Fri, 16 Feb 2024 01:17:31 +0100 Subject: FIX Disable cpuflags for very old JSON <0.20.0 - FIX for ol6/c6/rh6 --- modules/devices.c | 3 +++ modules/devices/x86/x86_data.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/devices.c b/modules/devices.c index 574896ee..614c43f5 100644 --- a/modules/devices.c +++ b/modules/devices.c @@ -37,6 +37,7 @@ #include "udisks2_util.h" #include "storage_util.h" #include "pci_util.h" +#include gchar *callback_processors(); gchar *callback_gpu(); @@ -857,10 +858,12 @@ void hi_module_init(void) .file_name = "sdcard.ids", }, #ifdef ARCH_x86 +#if JSON_CHECK_VERSION(0,20,0) { .name = N_("Update CPU flags database"), .file_name = "cpuflags.json", }, +#endif #endif }; guint i; diff --git a/modules/devices/x86/x86_data.c b/modules/devices/x86/x86_data.c index f56e8668..a2f8d7ca 100644 --- a/modules/devices/x86/x86_data.c +++ b/modules/devices/x86/x86_data.c @@ -330,7 +330,7 @@ void cpuflags_x86_init(void) gchar *flag_json = g_build_filename(g_get_user_config_dir(), "hardinfo2", "cpuflags.json", NULL); gboolean use_builtin_table = TRUE; - +#if JSON_CHECK_VERSION(0,20,0) if (!g_file_test(flag_json, G_FILE_TEST_EXISTS)) goto use_builtin_table; @@ -357,6 +357,7 @@ void cpuflags_x86_init(void) use_builtin_table_with_json: g_object_unref(parser); use_builtin_table: +#endif g_free(flag_json); if (use_builtin_table) -- cgit v1.2.3