From: Hans-Kristian Arntzen Subject: [PATCH v2 12/12] vkd3d: No-op implementation of get_program_name on Win32. Message-Id: <20191001103349.7899-12-post@arntzen-software.no> Date: Tue, 1 Oct 2019 12:33:49 +0200 In-Reply-To: <20191001103349.7899-1-post@arntzen-software.no> References: <20190930141641.10431-1-post@arntzen-software.no> <20191001103349.7899-1-post@arntzen-software.no> Signed-off-by: Hans-Kristian Arntzen --- libs/vkd3d/device.c | 2 +- libs/vkd3d/utils.c | 4 ++-- libs/vkd3d/vkd3d_private.h | 15 ++++++--------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 3da4273..460bdf9 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -453,7 +453,7 @@ static HRESULT vkd3d_instance_init(struct vkd3d_instance *instance, bool *user_extension_supported = NULL; VkApplicationInfo application_info; VkInstanceCreateInfo instance_info; - char application_name[PATH_MAX]; + char application_name[VKD3D_PATH_MAX]; uint32_t extension_count; const char **extensions; VkInstance vk_instance; diff --git a/libs/vkd3d/utils.c b/libs/vkd3d/utils.c index 6a910a7..624b14f 100644 --- a/libs/vkd3d/utils.c +++ b/libs/vkd3d/utils.c @@ -804,7 +804,7 @@ HRESULT vkd3d_load_vk_device_procs(struct vkd3d_vk_device_procs *procs, return S_OK; } -#ifdef _GNU_SOURCE +#if defined(_GNU_SOURCE) && !defined(_WIN32) bool vkd3d_get_program_name(char program_name[PATH_MAX]) { @@ -840,7 +840,7 @@ bool vkd3d_get_program_name(char program_name[PATH_MAX]) #else -bool vkd3d_get_program_name(char program_name[PATH_MAX]) +bool vkd3d_get_program_name(char program_name[VKD3D_PATH_MAX]) { *program_name = '\0'; return false; diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index d063492..a51ca4d 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -1231,16 +1231,13 @@ HRESULT vkd3d_load_vk_device_procs(struct vkd3d_vk_device_procs *procs, extern const char vkd3d_build[]; -bool vkd3d_get_program_name(char program_name[PATH_MAX]) DECLSPEC_HIDDEN; - -static inline void vkd3d_set_thread_name(const char *name) -{ -#if defined(HAVE_PTHREAD_SETNAME_NP_2) - pthread_setname_np(pthread_self(), name); -#elif defined(HAVE_PTHREAD_SETNAME_NP_1) - pthread_setname_np(name); +#ifdef PATH_MAX +#define VKD3D_PATH_MAX PATH_MAX +#else +#define VKD3D_PATH_MAX 256 #endif -} + +bool vkd3d_get_program_name(char program_name[VKD3D_PATH_MAX]) DECLSPEC_HIDDEN; VkResult vkd3d_set_vk_object_name_utf8(struct d3d12_device *device, uint64_t vk_object, VkDebugReportObjectTypeEXT vk_object_type, const char *name) DECLSPEC_HIDDEN; -- 2.23.0