From d139c8799b3ed902e2942d6453607e18a9beffb4 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 26 May 2025 08:56:44 +0200 Subject: [PATCH] [winpr,wtypes] align BOOL typedef with objc.h header --- winpr/include/winpr/wtypes.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/winpr/include/winpr/wtypes.h b/winpr/include/winpr/wtypes.h index d00932920..067136c34 100644 --- a/winpr/include/winpr/wtypes.h +++ b/winpr/include/winpr/wtypes.h @@ -95,11 +95,13 @@ typedef int32_t BOOL; #include /* ensure compatibility with objc libraries */ -#if (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE != 0) && defined(__LP64__)) || \ - (defined(TARGET_OS_WATCH) && (TARGET_OS_WATCH != 0)) +#if OBJC_BOOL_IS_BOOL typedef bool BOOL; #else +#define OBJC_BOOL_IS_CHAR 1 typedef signed char BOOL; +// BOOL is explicitly signed so @encode(BOOL) == "c" rather than "C" +// even if -funsigned-char is used. #endif #endif /* __APPLE__ */ #endif /* __OBJC__ */