Signed-off-by: Hans-Kristian Arntzen post@arntzen-software.no --- libs/vkd3d/device.c | 2 +- libs/vkd3d/utils.c | 8 ++++---- libs/vkd3d/vkd3d_private.h | 8 +++++++- 3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 0624318..cc8e282 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 cf0448d..64eb845 100644 --- a/libs/vkd3d/utils.c +++ b/libs/vkd3d/utils.c @@ -830,7 +830,7 @@ HRESULT vkd3d_load_vk_device_procs(struct vkd3d_vk_device_procs *procs,
#if HAVE_DECL_PROGRAM_INVOCATION_NAME
-bool vkd3d_get_program_name(char program_name[PATH_MAX]) +bool vkd3d_get_program_name(char program_name[VKD3D_PATH_MAX]) { char *name, *p, *real_path = NULL;
@@ -856,15 +856,15 @@ bool vkd3d_get_program_name(char program_name[PATH_MAX]) name = program_invocation_name; }
- strncpy(program_name, name, PATH_MAX); - program_name[PATH_MAX - 1] = '\0'; + strncpy(program_name, name, VKD3D_PATH_MAX); + program_name[VKD3D_PATH_MAX - 1] = '\0'; free(real_path); return true; }
#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 84b5ff2..a90f7e5 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -54,6 +54,12 @@ #define VKD3D_MAX_SHADER_STAGES 5u #define VKD3D_MAX_VK_SYNC_OBJECTS 4u
+#ifdef _WIN32 +#define VKD3D_PATH_MAX _MAX_PATH +#else +#define VKD3D_PATH_MAX PATH_MAX +#endif + struct d3d12_command_list; struct d3d12_device; struct d3d12_resource; @@ -1271,7 +1277,7 @@ 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; +bool vkd3d_get_program_name(char program_name[VKD3D_PATH_MAX]) DECLSPEC_HIDDEN;
static inline void vkd3d_set_thread_name(const char *name) {