Skip to content

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

Description

@Challanger524
[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__)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions