Fix compilation on 32bit systems
authorNikolaus Rath <Nikolaus@rath.org>
Thu, 3 Aug 2017 10:56:02 +0000 (12:56 +0200)
committerNikolaus Rath <Nikolaus@rath.org>
Thu, 3 Aug 2017 10:58:09 +0000 (12:58 +0200)
Fixes: #185.
ChangeLog.rst
example/passthrough_ll.c

index 0e16efbe1c2e9221183bf18a7163b5294e03d06d..091adabd1b4c98b55f119e361d45686fe5473b61 100644 (file)
@@ -1,3 +1,9 @@
+Unreleased Changes
+==================
+
+* Fixed a compilation problem of the passthrough_ll example on
+  32 bit systems (wrong check and wrong error message).
+
 libfuse 3.1.0 (2017-07-08)
 ==========================
 
index fc633f534d6cfe5a5978d274098ae80f9cb74788..2d7d4b52c44ece3f32760ec51ea04a881a2435bc 100644 (file)
 #include <err.h>
 
 /* We are re-using pointers to our `struct lo_inode` and `struct
-   lo_dirp` elements as inodes. This means that we require uintptr_t
-   and fuse_ino_t to have the same size. The following incantation
-   defines a compile time assert for this requirement. */
+   lo_dirp` elements as inodes. This means that we must be able to
+   store uintptr_t values in a fuse_ino_t variable. The following
+   incantation checks this condition at compile time. */
 #if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 6) && !defined __cplusplus
-_Static_assert(sizeof(fuse_ino_t) == sizeof(uintptr_t), "fuse: off_t must be 64bit");
+_Static_assert(sizeof(fuse_ino_t) >= sizeof(uintptr_t),
+              "fuse_ino_t too small to hold uintptr_t values!");
 #else
 struct _uintptr_to_must_hold_fuse_ino_t_dummy_struct \
        { unsigned _uintptr_to_must_hold_fuse_ino_t:
-                       ((sizeof(fuse_ino_t) == sizeof(uintptr_t)) ? 1 : -1); };
+                       ((sizeof(fuse_ino_t) >= sizeof(uintptr_t)) ? 1 : -1); };
 #endif
 
-
 /* Compat stuff.  Doesn't make it work, just makes it compile. */
 #ifndef HAVE_FSTATAT
 #warning fstatat(2) needed by this program