On macOS the file objc/objc.h defines macros YES and NO as part of the Objective-C BOOL type definition. Milton also defines its own YesNoCancelAnswer enumeration type containing values YES and NO.
On macOS this causes a conflict where the compiler attempts macro expansion on the definitions of YesNoCancelAnswer::YES and YesNoCancelAnswer::NO. This leads to compilation failure.
To fix this failure, this change renames the constants of YesNoCancelAnswer from YES to YES_, NO to NO_, and for consistency from CANCEL to CANCEL_. All occurrences of the previous constants are replaced.
In addition, this change adds the required function platform_dialog_yesnocancel to src/platform_mac.mm. This displays a Yes/No/Cancel dialog box on macOS and returns the users response.
TESTED
[X] Compiles on macOS Mojave (v10.14.6) without error.
DESCRIPTION Closes #149
On macOS the file
objc/objc.h
defines macrosYES
andNO
as part of the Objective-CBOOL
type definition. Milton also defines its ownYesNoCancelAnswer
enumeration type containing valuesYES
andNO
.On macOS this causes a conflict where the compiler attempts macro expansion on the definitions of
YesNoCancelAnswer::YES
andYesNoCancelAnswer::NO
. This leads to compilation failure.To fix this failure, this change renames the constants of
YesNoCancelAnswer
fromYES
toYES_
,NO
toNO_
, and for consistency fromCANCEL
toCANCEL_
. All occurrences of the previous constants are replaced.In addition, this change adds the required function
platform_dialog_yesnocancel
tosrc/platform_mac.mm
. This displays a Yes/No/Cancel dialog box on macOS and returns the users response.TESTED