From 22dac966baee478fcaf0ef13833678dced1a4f55 Mon Sep 17 00:00:00 2001 From: CodingKoopa Date: Fri, 8 Mar 2024 05:59:20 +0000 Subject: [PATCH] win32_io.c: undefine all enum constants Some of the STATUS enum constants conflict with those from winnt.h. This change undefines all of them to be safe. Fixes compiler error: In file included 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: win32_io.c:132:4: error: expected identifier before '(' token 132 | STATUS_INVALID_HANDLE = 0xC0000008, | ^~~~~~~~~~~~~~~~~~~~~ --- libntfs-3g/win32_io.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/libntfs-3g/win32_io.c b/libntfs-3g/win32_io.c index 7e76f638..d6783ead 100644 --- a/libntfs-3g/win32_io.c +++ b/libntfs-3g/win32_io.c @@ -125,6 +125,30 @@ static LPFN_SETFILEPOINTEREX fnSetFilePointerEx = NULL; #define FNPOSTFIX "A" #endif +/* + * Since many of the ahead enum constants conflict with winnt.h defines, + * make sure that each enum constant is undefined. + */ + +#undef STATUS_UNKNOWN +#undef STATUS_SUCCESS +#undef STATUS_BUFFER_OVERFLOW +#undef STATUS_INVALID_HANDLE +#undef STATUS_INVALID_PARAMETER +#undef STATUS_INVALID_DEVICE_REQUEST +#undef STATUS_END_OF_FILE +#undef STATUS_CONFLICTING_ADDRESSES +#undef STATUS_NO_MATCH +#undef STATUS_ACCESS_DENIED +#undef STATUS_BUFFER_TOO_SMALL +#undef STATUS_OBJECT_TYPE_MISMATCH +#undef STATUS_FILE_NOT_FOUND +#undef STATUS_OBJECT_NAME_INVALID +#undef STATUS_OBJECT_NAME_NOT_FOUND +#undef STATUS_SHARING_VIOLATION +#undef STATUS_INVALID_PARAMETER_1 +#undef STATUS_IO_DEVICE_ERROR +#undef STATUS_GUARD_PAGE_VIOLATION enum { /* see http://msdn.microsoft.com/en-us/library/cc704588(v=prot.10).aspx */ STATUS_UNKNOWN = -1, STATUS_SUCCESS = 0x00000000,