From c7a5a0bc1b823aced7b3e3114ef101e8238e43e5 Mon Sep 17 00:00:00 2001 From: Julian Petrov Date: Wed, 27 Jul 2022 13:04:09 -0400 Subject: [PATCH] u/file: Make more functions work on Windows --- src/xrt/auxiliary/util/u_file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xrt/auxiliary/util/u_file.c b/src/xrt/auxiliary/util/u_file.c index 01d112530..7cb6cc19a 100644 --- a/src/xrt/auxiliary/util/u_file.c +++ b/src/xrt/auxiliary/util/u_file.c @@ -15,10 +15,10 @@ #include #include #include -#include #ifdef XRT_OS_LINUX +#include #include static int @@ -104,6 +104,10 @@ u_file_open_file_in_config_dir(const char *filename, const char *mode) return fopen(file_str, mode); } +#else if defined(XRT_OS_WINDOWS) +#define PATH_MAX MAX_PATH +#endif + ssize_t u_file_get_runtime_dir(char *out_path, size_t out_path_size) { @@ -128,8 +132,6 @@ u_file_get_path_in_runtime_dir(const char *suffix, char *out_path, size_t out_pa return snprintf(out_path, out_path_size, "%s/%s", tmp, suffix); } -#endif - char * u_file_read_content(FILE *file) {