Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wincompat.h macro condition is missing 3rd case for MinGW (MSYS2/clang64) #238

Open
Challanger524 opened this issue Apr 23, 2024 · 1 comment

Comments

@Challanger524
Copy link
Contributor

Challanger524 commented Apr 23, 2024

[build] libconfig/lib/libconfig.c:682:10: error: call to undeclared function 'fsync'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
[build]   682 |       if(posix_fsync(fd) != 0)
[build]       |          ^
[build] libconfig/lib/wincompat.h:120:22: note: expanded from macro 'posix_fsync'
[build]   120 | #define posix_fsync  fsync

Silly quick workaround - create 3rd missing case for msys2 (starts from line 96)

--- a/lib/wincompat.h
+++ b/lib/wincompat.h
@@ -94,6 +94,17 @@ extern int posix_fsync(int fd);
 #endif /* defined(WIN32) || defined(__MINGW32__) */

 #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
+  || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) \
+  && defined(__MINGW32__)
+
+#define INT64_CONST(I)  (I ## LL)
+#define UINT64_CONST(I) (I ## ULL)
+
+#include <Shlwapi.h>
+#define IS_RELATIVE_PATH(P) \
+  (PathIsRelativeA(P))
+
+#elif (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
   || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) \
   && ! defined(__MINGW32__)
@Challanger524
Copy link
Contributor Author

@hyperrealm I don't know how to fix this issue in the right way without a knowing person

@Challanger524 Challanger524 changed the title wincompat.h macro condition is missing 3rd case for msys64/clang64 wincompat.h macro condition is missing 3rd case for MinGW (MSYS2/clang64`) Jan 30, 2025
@Challanger524 Challanger524 changed the title wincompat.h macro condition is missing 3rd case for MinGW (MSYS2/clang64`) wincompat.h macro condition is missing 3rd case for MinGW (MSYS2/clang64) Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant