[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 5/5] cutils: Add missing dyld(3) include on macOS
From: |
Peter Maydell |
Subject: |
[PULL 5/5] cutils: Add missing dyld(3) include on macOS |
Date: |
Fri, 12 Aug 2022 12:45:27 +0100 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Commit 06680b15b4 moved qemu_*_exec_dir() to cutils but forgot
to move the macOS dyld(3) include, resulting in the following
error (when building with Homebrew GCC on macOS Monterey 12.4):
[313/1197] Compiling C object libqemuutil.a.p/util_cutils.c.o
FAILED: libqemuutil.a.p/util_cutils.c.o
../../util/cutils.c:1039:13: error: implicit declaration of function
'_NSGetExecutablePath' [-Werror=implicit-function-declaration]
1039 | if (_NSGetExecutablePath(fpath, &len) == 0) {
| ^~~~~~~~~~~~~~~~~~~~
../../util/cutils.c:1039:13: error: nested extern declaration of
'_NSGetExecutablePath' [-Werror=nested-externs]
Fix by moving the include line to cutils.
Fixes: 06680b15b4 ("include: move qemu_*_exec_dir() to cutils")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220809222046.30812-1-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
util/cutils.c | 4 ++++
util/oslib-posix.c | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/util/cutils.c b/util/cutils.c
index cb43dda213c..def9c746ced 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -39,6 +39,10 @@
#include <kernel/image.h>
#endif
+#ifdef __APPLE__
+#include <mach-o/dyld.h>
+#endif
+
#ifdef G_OS_WIN32
#include <pathcch.h>
#include <wchar.h>
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index bffec18869e..d55af69c112 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -58,10 +58,6 @@
#include <lwp.h>
#endif
-#ifdef __APPLE__
-#include <mach-o/dyld.h>
-#endif
-
#include "qemu/mmap-alloc.h"
#ifdef CONFIG_DEBUG_STACK_USAGE
--
2.25.1
- [PULL 0/5] target-arm queue, Peter Maydell, 2022/08/12
- [PULL 3/5] tests/unit: fix a -Wformat-truncation warning, Peter Maydell, 2022/08/12
- [PULL 2/5] Fix some typos in documentation (most of them found by codespell), Peter Maydell, 2022/08/12
- [PULL 4/5] hw/arm/virt-acpi-build: Present the GICR structure properly for GICv4, Peter Maydell, 2022/08/12
- [PULL 5/5] cutils: Add missing dyld(3) include on macOS,
Peter Maydell <=
- [PULL 1/5] target/arm: Don't report Statistical Profiling Extension in ID registers, Peter Maydell, 2022/08/12
- Re: [PULL 0/5] target-arm queue, Richard Henderson, 2022/08/12