From 3f8de9d3272d6ea1ea76420f593dc4fa9e8ab09f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81o=C5=9B?= Date: Fri, 15 Sep 2023 09:01:44 +0200 Subject: [PATCH] Define PN_XNUM if not defined in elf.h VxWorks elf.h (nor any other header in its SDK) doesn't contain definition of PN_XNUM, which meaning is the limit of program headers in ELF structure, related to `e_phnum` field of `Elf{32,64}_Ehdr` structures. Since these fields have identical type and seemingly identical meaning, we can safely assume that its maximum value will be the same on both systems. Define PN_XNUM if it's not defined with `0xffff` value taken from Linux and Solaris related headers. Fixes: QTBUG-118135 Change-Id: I5a0dab1d1d18e165d01e80823a02f7df644fc7e8 Reviewed-by: Thiago Macieira --- src/corelib/plugin/qelfparser_p.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp index f994b9970f..0bbadb2933 100644 --- a/src/corelib/plugin/qelfparser_p.cpp +++ b/src/corelib/plugin/qelfparser_p.cpp @@ -54,6 +54,10 @@ static Q_LOGGING_CATEGORY(lcElfParser, "qt.core.plugin.elfparser") # define PT_GNU_PROPERTY 0x6474e553 #endif +#ifndef PN_XNUM +# define PN_XNUM 0xffff +#endif + QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wunused-const-variable")