From 1d41d03671fc4acf2e069b962a3e7e087360ef2f Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 5 Mar 2025 22:41:43 -0500 Subject: [PATCH] Don't compile util/symlinks on Windows This helper program is only needed when building elf shared libraries, and for some reason Windows is failing to compile POSIX's struct stat. Windows doesn't support symlinks anyway. Signed-off-by: Theodore Ts'o --- util/symlinks.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util/symlinks.c b/util/symlinks.c index 4c721560..4b0b788e 100644 --- a/util/symlinks.c +++ b/util/symlinks.c @@ -17,6 +17,16 @@ #include #include +#if (defined _WIN32 || defined _WIN64 || defined __WINDOWS__) + +int main(int argc, char **argv) +{ + printf("symlinks not supported on Windows\n"); + return 1; +} + +#else + #ifndef S_ISLNK #define S_ISLNK(mode) (((mode) & (_S_IFMT)) == (_S_IFLNK)) #endif @@ -381,3 +391,5 @@ int main(int argc, char **argv) usage_error(); exit (0); } + +#endif /* !(defined _WIN32 || defined _WIN64 || defined __WINDOWS__) */ -- 2.47.2