util/test: Use MAX_PATH on Windows

Windows provides MAX_PATH rather than PATH_MAX for the maximum allowable
path length. This is not a limit on the length of filename which can
exist on the filesystem, but a length on the length of path which can be
passed to Win32 API calls.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Fixes: f8f1413070 ("util/u_process: add util_get_process_exec_path")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4304>
This commit is contained in:
Daniel Stone 2020-03-26 13:01:58 +00:00
parent 8f573bdaaa
commit bc98de4d14

View file

@ -31,6 +31,11 @@
#include <limits.h>
#include <stdlib.h>
#if DETECT_OS_WINDOWS && !defined(PATH_MAX)
#include <windows.h>
#define PATH_MAX MAX_PATH
#endif
bool error = false;
static void