program_invocation_name isn't available on macOS, let's use getprogname() instead.
Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- libs/vkd3d/utils.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d/utils.c b/libs/vkd3d/utils.c index cdc5512..a5f18ef 100644 --- a/libs/vkd3d/utils.c +++ b/libs/vkd3d/utils.c @@ -577,7 +577,16 @@ HRESULT vkd3d_load_vk_device_procs(struct vkd3d_vk_device_procs *procs, return S_OK; }
-#ifdef _GNU_SOURCE +#ifdef __APPLE__ + +bool vkd3d_get_program_name(char program_name[PATH_MAX]) +{ + strncpy(program_name, getprogname(), PATH_MAX); + program_name[PATH_MAX - 1] = '\0'; + return true; +} + +#elif defined(_GNU_SOURCE)
bool vkd3d_get_program_name(char program_name[PATH_MAX]) {