Skip to content

fuse: Define RENAME_* macros when they are not defined

These macros exist in Linux headers, but they don't exist on FreeBSD. Since fuse library always uses the same values regardless of the platform, we just define them ourselves when they aren't defined.

This fixes compilation error on FreeBSD:

[87/247] Compiling C object 'client/948fe60@@gvfsd-fuse@exe/gvfsfusedaemon.c.o'.
FAILED: client/948fe60@@gvfsd-fuse@exe/gvfsfusedaemon.c.o 
clang -B/home/lantw44/.local/bin -Iclient/948fe60@@gvfsd-fuse@exe -Iclient -I../../source/gvfs/client -I. -I../../source/gvfs/ -Icommon -I../../source/gvfs/common -I/usr/local/include/fuse3 -I/home/lantw44/gnome/devinstall/include/glib-2.0 -I/home/lantw44/gnome/devinstall/lib/glib-2.0/include -I/usr/local/lib/libffi-3.2.1/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g -DHAVE_CONFIG_H -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-sign-compare -Wno-strict-aliasing -march=corei7 -B/home/lantw44/.local/bin -g3 -Og -gz -fdebug-macro -pthread '-DG_LOG_DOMAIN="GVFS"' '-DGVFS_LOCALEDIR="/home/lantw44/gnome/devinstall/share/locale"' '-DGVFS_MODULE_DIR="/home/lantw44/gnome/devinstall/lib/gvfs/modules"' -UG_LOG_DOMAIN -MD -MQ 'client/948fe60@@gvfsd-fuse@exe/gvfsfusedaemon.c.o' -MF 'client/948fe60@@gvfsd-fuse@exe/gvfsfusedaemon.c.o.d' -o 'client/948fe60@@gvfsd-fuse@exe/gvfsfusedaemon.c.o' -c ../../source/gvfs/client/gvfsfusedaemon.c
../../source/gvfs/client/gvfsfusedaemon.c:1667:19: error: use of undeclared identifier 'RENAME_EXCHANGE'
  if (vfs_flags & RENAME_EXCHANGE)
                  ^
../../source/gvfs/client/gvfsfusedaemon.c:1670:19: error: use of undeclared identifier 'RENAME_NOREPLACE'
  if (vfs_flags & RENAME_NOREPLACE)
                  ^
2 errors generated.

Merge request reports