../../src/gallium/auxiliary/hud/hud_context.c:1017:1: error: static declaration of 'access' follows non-static declaration
These error will shown when any header #include <io.h>
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18333>
#include <signal.h>
#include <stdio.h>
+#include "util/detect_os.h"
+
+#if DETECT_OS_WINDOWS
+#include <io.h>
+
+/**
+ * Access flags W_OK are defined by mingw, but not defined by MSVC, we defined it according to
+ * https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/access-waccess
+ */
+#ifndef W_OK
+#define W_OK 02
+#endif
+#endif /* DETECT_OS_WINDOWS */
+
#include "hud/hud_context.h"
#include "hud/hud_private.h"
}
-#ifdef PIPE_OS_WINDOWS
-#define W_OK 0
-static int
-access(const char *pathname, int mode)
-{
- /* no-op */
- return 0;
-}
+#if DETECT_OS_WINDOWS
#define PATH_SEP "\\"