From 77f3ea476ec0636c34dfd141e96be64173d96977 Mon Sep 17 00:00:00 2001 From: Eleni Maria Stea Date: Thu, 4 Nov 2021 12:13:21 +0200 Subject: [PATCH] loader, asm_offset: define BSD_VISIBLE and fix ifdef bug In vk_loader_platform.h there was a leftover #if defined (__FreeBSD__) ... elif #defined(__FreeBSD__) that needed fixing. After that it was necessary to define BSD_VISIBLE before including required by required by asm_offset and loader CMakeLists.txt had to be modified accordingly. --- loader/CMakeLists.txt | 1 + loader/vk_loader_platform.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 56aece67..4a084b4f 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -308,6 +308,7 @@ else() target_compile_definitions(vulkan PRIVATE _GNU_SOURCE) if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") target_compile_definitions(vulkan PRIVATE __BSD_VISIBLE=1) + target_compile_definitions(asm_offset PRIVATE __BSD_VISIBLE=1) endif() if(APPLE) find_library(COREFOUNDATION_LIBRARY NAMES CoreFoundation) diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h index ecb8e100..507a9012 100644 --- a/loader/vk_loader_platform.h +++ b/loader/vk_loader_platform.h @@ -156,7 +156,7 @@ static inline bool loader_platform_is_path_absolute(const char *path) { static inline char *loader_platform_dirname(char *path) { return dirname(path); } -#if defined(__linux__) || defined(__FreeBSD__) +#if defined(__linux__) // find application path + name. Path cannot be longer than 1024, returns NULL if it is greater than that. static inline char *loader_platform_executable_path(char *buffer, size_t size) { -- 2.34.1