[PATCH vkd3d] vkd3d: Add vkd3d_get_program_name() implementation for macOS.

Józef Kucia joseph.kucia at gmail.com
Thu Aug 1 02:29:41 CDT 2019


On Thu, Aug 1, 2019 at 4:46 AM Jactry Zeng <jzeng at codeweavers.com> wrote:
> -#ifdef _GNU_SOURCE
> +#ifdef __APPLE__

It's probably better to test for getprogname() instead of __APPLE__.

> +bool vkd3d_get_program_name(char program_name[PATH_MAX])
> +{
> +    strncpy(program_name, getprogname(), PATH_MAX);
> +    program_name[PATH_MAX - 1] = '\0';

strncpy() always adds a terminating null byte.

> +    return true;
> +}

vkd3d_get_program_name() is supposed to get just the name of the
executable, e.g. it needs to extract it from the full path. Our other
implementation also extracts the executable name when a program is run
under Wine. I'm afraid it might not be as simple as calling
getprogrname().

Moreover, in the long term it might not be necessary to have an
implementation of vkd3d_get_program_name() for programs running under
Wine. We'll probably start filling vkd3d_application_info in Wine
after the next vkd3d release.



More information about the wine-devel mailing list