From 9038bb8dca09c3842ad32f876f0509e366d86a8e Mon Sep 17 00:00:00 2001 From: CodingKoopa Date: Fri, 8 Mar 2024 05:52:33 +0000 Subject: [PATCH] win32_io.c: use different BOOL workaround 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 ' 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 --- libntfs-3g/win32_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libntfs-3g/win32_io.c b/libntfs-3g/win32_io.c index 41c43c6b..7e76f638 100644 --- a/libntfs-3g/win32_io.c +++ b/libntfs-3g/win32_io.c @@ -27,9 +27,9 @@ #include "config.h" #ifdef HAVE_WINDOWS_H -#define BOOL WINBOOL /* avoid conflicting definitions of BOOL */ +#define _NO_BOOL_TYPEDEF /* supported by both Cygwin and MinGW-w64's w32api */ #include -#undef BOOL +#undef _NO_BOOL_TYPEDEF #endif #ifdef HAVE_STDLIB_H