cocoa: fix the declaration of boolean use. #35792

git-svn-id: trunk@61529 -
This commit is contained in:
dmitry 2019-07-04 22:27:03 +00:00
parent 12bd4546ad
commit a1b263e461
3 changed files with 16 additions and 12 deletions

View File

@ -27,6 +27,16 @@ uses
// Libs
MacOSAll, CocoaAll;
type
// Due to backwards incompatible changes in FPC sources
// (switching from Boolean to Boolean8), LCL has to adopt
// either type, depending on FPC version
LCLObjCBoolean = {$ifdef HASBOOLEAN8}
Boolean8 // FPC 3.2.0 and earlier are using "boolean8" type
{$else}
Boolean // FPC 3.0.4 and earlier are using "boolean" type
{$endif};
type
NSImageScaling = NSUInteger;
const // NSImageScaling values
@ -42,6 +52,10 @@ type
{$ifdef BOOLFIX}
ObjCBool = ShortInt; // Matches BOOL declaration in ObjC "signed char"
// Note that this is different than LCLObjCBoolean
// even though it's trying to resolve the same problem
// for FPC3.0.4. ObjCBool should be removed after the officail
// fpc3.2+ release
NSMenuItemFix = objccategory external (NSMenuItem)
procedure setEnabled_(aenabled: ObjCBool); message 'setEnabled:';

View File

@ -46,16 +46,6 @@ const
{$define HASBOOLEAN8}
{$endif}
type
// Due to backwards incompatible changes in FPC sources
// (switching from Boolean to Boolean8), LCL has to adopt
// either type, depending on FPC version
LCLObjCBoolean = {$ifdef HASBOOLEAN8}
Boolean8 // FPC 3.2.0 and earlier are using "boolean8" type
{$else}
Boolean // FPC 3.0.4 and earlier are using "boolean" type
{$endif};
type
{ ICommonCallback }

View File

@ -130,7 +130,7 @@ type
procedure unmarkText;
function selectedRange: NSRange;
function markedRange: NSRange;
function hasMarkedText: Boolean;
function hasMarkedText: LCLObjCBoolean;
function attributedSubstringForProposedRange_actualRange(aRange: NSRange; actualRange: NSRangePointer): NSAttributedString;
function validAttributesForMarkedText: NSArray;
function firstRectForCharacterRange_actualRange(aRange: NSRange; actualRange: NSRangePointer): NSRect;
@ -691,7 +691,7 @@ begin
Result.length := 0;
end;
function TCocoaInputClient.hasMarkedText: Boolean;
function TCocoaInputClient.hasMarkedText: LCLObjCBoolean;
begin
Result := false;
end;