ref: 2c65634c88ea7564deb4df78c529b929027e477f
parent: 8b5f8089f293105a48fdd41d976988f1b98a4c19
parent: c6bc9714dd9e3ba1e022327f607ea09c40440d3d
author: Christopher Snowhill <kode54@gmail.com>
date: Sat Oct 7 14:29:05 EDT 2017
Merge pull request #69 from Rondom/classic-mingw Make LFS-checks work with MinGW.org-MinGW
--- a/include/dumb.h
+++ b/include/dumb.h
@@ -98,9 +98,18 @@
typedef DUMB_OFF_T_CUSTOM dumb_off_t;
#elif defined _MSC_VER || defined __WATCOMC__
typedef __int64 dumb_off_t;
-#elif defined __DJGPP__
+#elif defined __DJGPP__ || defined __MINGW32__
+/* MingW-W64 does not have off64_t and supports _FILE_OFFSET_BITS,
+ * DJGPP and old MinGW do have off64_t, but don't support _FILE_OFFSET_BITS.
+ */
+#include <sys/types.h>
+#if defined(__MINGW64_VERSION_MAJOR)
+typedef off_t dumb_off_t;
+#else
typedef off64_t dumb_off_t;
-#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 500 || defined __MINGW32__
+#endif
+#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 500
+#include <sys/types.h>
typedef off_t dumb_off_t;
#else
typedef long long dumb_off_t;
@@ -118,7 +127,7 @@
*/
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && \
!defined __cplusplus
-_Static_assert(sizeof(dumb_off_t) >= 8, "fuse: off_t must be 64bit");
+_Static_assert(sizeof(dumb_off_t) >= 8, "dumb: off_t must be 64bit");
#else
struct dumb_off_t_needs_to_be_at_least_8_bytes {
unsigned int dumb_off_t_needs_to_be_at_least_8_bytes_