Skip to content
Snippets Groups Projects
  • Philippe Mathieu-Daudé's avatar
    4311682e
    cutils: Add missing dyld(3) include on macOS · 4311682e
    Philippe Mathieu-Daudé authored
    
    Commit 06680b15 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: 06680b15 ("include: move qemu_*_exec_dir() to cutils")
    Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20220809222046.30812-1-f4bug@amsat.org
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    4311682e
    History
    cutils: Add missing dyld(3) include on macOS
    Philippe Mathieu-Daudé authored
    
    Commit 06680b15 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: 06680b15 ("include: move qemu_*_exec_dir() to cutils")
    Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20220809222046.30812-1-f4bug@amsat.org
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>