Fixes compiler error:
In file included from ../include/ntfs-3g/logging.h:34,
from ../include/ntfs-3g/debug.h:29,
from win32_io.c:73:
../include/ntfs-3g/types.h:114:3: error: conflicting types for 'BOOL'; have 'enum <anonymous>'
114 | } BOOL;
| ^~~~
In file included from /usr/include/w32api/windef.h:9,
from /usr/include/w32api/windows.h:69,
from win32_io.c:31:
/usr/include/w32api/minwindef.h:131:15: note: previous declaration of 'BOOL' with type 'BOOL' {aka 'int'}
131 | typedef int BOOL;
| ^~~~
This leverages the fact that, in minwindef.h, the definition is guarded like so:
#if !defined(__OBJC__) && !defined(__OBJC_BOOL) && !defined(__objc_INCLUDE_GNU) && !defined(_NO_BOOL_TYPEDEF)
typedef int BOOL;
#endif
This conflicts with the GUID defined in the Windows headers, and we don't seem to use this one.
Fixes compiler error (could also be fixed by redefining Windows' GUID):
win32_io.c:55:3: error: conflicting types for 'GUID'; have 'struct <anonymous>'
55 | } GUID;
| ^~~~
In file included from /usr/include/w32api/winnt.h:648,
from /usr/include/w32api/minwindef.h:163,
from /usr/include/w32api/windef.h:9,
from /usr/include/w32api/windows.h:69,
from win32_io.c:31:
/usr/include/w32api/guiddef.h:24:3: note: previous declaration of 'GUID' with type 'GUID'
24 | } GUID;
| ^~~~
On linux the request argument of ioctl() is defined as an unsigned long,
but the fuse protocol squashes it into a signed int. As a consequence
the value received by ntfs-3g may appear as negative and different from
the value defined by the corresponding macro.
So define the request argument as unsigned long in ntfs-3g. It has
however to be fed as unsigned from fuse until the fuse protocol is
updated.
Upgrade the Win32 interface (win32_io.c) which was designed for Cygwin
so that it can be used for using the ntfsprogs utilities on native Windows.
Two new entries are added for truncating a file and creating a sparse
file, both of which not being supported through msvcrt.dll.