From 3d742db3a9dc6eba0a204f30236b3dc08394d1d7 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 12 Dec 2025 12:40:24 +0100 Subject: [PATCH] os: xtrans: declare trans_mkdir() static function only if needed Win32/mingw32 doesn't need it, so compiler warns on it. Signed-off-by: Enrico Weigelt, metux IT consult --- os/Xtransint.h | 2 ++ os/Xtransutil.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/os/Xtransint.h b/os/Xtransint.h index 4c167ee5cb..5918020100 100644 --- a/os/Xtransint.h +++ b/os/Xtransint.h @@ -235,10 +235,12 @@ typedef struct _Xtransport_table { #pragma clang diagnostic ignored "-Wunused-function" #endif +#ifndef WIN32 static int trans_mkdir ( const char *, /* path */ int /* mode */ ); +#endif #ifdef __clang__ #pragma clang diagnostic pop diff --git a/os/Xtransutil.c b/os/Xtransutil.c index e665acf01f..58192e4e18 100644 --- a/os/Xtransutil.c +++ b/os/Xtransutil.c @@ -240,6 +240,7 @@ int _XSERVTransConvertAddress(int *familyp, int *addrlenp, Xtransaddr **addrp) * it's not save if the directory has non-root ownership or the sticky * bit cannot be set and fail. */ +#ifndef WIN32 static int trans_mkdir(const char *path, int mode) { @@ -388,3 +389,4 @@ trans_mkdir(const char *path, int mode) /* In all other cases, fail */ return -1; } +#endif