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 <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
pull/106/head
CodingKoopa 2024-03-08 05:52:33 +00:00
parent 13d341356b
commit 9038bb8dca
1 changed files with 2 additions and 2 deletions

View File

@ -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 <windows.h>
#undef BOOL
#undef _NO_BOOL_TYPEDEF
#endif
#ifdef HAVE_STDLIB_H