diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | include/fuse_common.h | 19 |
2 files changed, 17 insertions, 5 deletions
@@ -6,6 +6,9 @@ * libfuse: use O_CLOEXEC flag when opening /dev/fuse device. Patch by Richard W.M. Jones + * libfuse: don't force -D_FILE_OFFSET_BITS=64 in pkgconfig file. + Patch by Richard W.M. Jones + 2013-02-19 Miklos Szeredi <miklos@szeredi.hu> * fuse_daemonize(): chdir to "/" even if not running in the diff --git a/include/fuse_common.h b/include/fuse_common.h index 78d3ce4..af16203 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -27,11 +27,6 @@ #define FUSE_MAKE_VERSION(maj, min) ((maj) * 10 + (min)) #define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION) -/* This interface uses 64 bit off_t */ -#if _FILE_OFFSET_BITS != 64 -#error Please add -D_FILE_OFFSET_BITS=64 to your compile flags! -#endif - #ifdef __cplusplus extern "C" { #endif @@ -483,4 +478,18 @@ void fuse_remove_signal_handlers(struct fuse_session *se); } #endif + +/* + * This interface uses 64 bit off_t. + * + * On 32bit systems please add -D_FILE_OFFSET_BITS=64 to your compile flags! + */ + +#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 6) && !defined __cplusplus +_Static_assert(sizeof(off_t) == 8, "fuse: off_t must be 64bit"); +#else +struct _fuse_off_t_must_be_64bit_dummy_struct \ + { unsigned _fuse_off_t_must_be_64bit:((sizeof(off_t) == 8) ? 1 : -1); }; +#endif + #endif /* _FUSE_COMMON_H_ */ |