Skip to content

Commit 8e6c485

Browse files
committed
Fix BOOL on Aarch64
1 parent 036c3de commit 8e6c485

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

cocoa-foundation/src/foundation.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use std::os::raw::c_void;
1414
use base::{id, BOOL, NO, SEL, nil};
1515
use block::Block;
1616
use libc;
17+
use objc2::runtime::Bool;
1718
use objc2_encode::{Encode, Encoding, RefEncode};
1819

1920

@@ -368,17 +369,17 @@ pub trait NSDictionary: Sized {
368369

369370
unsafe fn keyEnumerator(self) -> id;
370371
unsafe fn objectEnumerator(self) -> id;
371-
unsafe fn enumerateKeysAndObjectsUsingBlock_(self, block: *mut Block<(id, id, *mut BOOL), ()>);
372+
unsafe fn enumerateKeysAndObjectsUsingBlock_(self, block: *mut Block<(id, id, *mut Bool), ()>);
372373
unsafe fn enumerateKeysAndObjectsWithOptions_usingBlock_(self, opts: NSEnumerationOptions,
373-
block: *mut Block<(id, id, *mut BOOL), ()>);
374+
block: *mut Block<(id, id, *mut Bool), ()>);
374375

375376
unsafe fn keysSortedByValueUsingSelector_(self, comparator: SEL) -> id;
376377
unsafe fn keysSortedByValueUsingComparator_(self, cmptr: NSComparator) -> id;
377378
unsafe fn keysSortedByValueWithOptions_usingComparator_(self, opts: NSEnumerationOptions, cmptr: NSComparator) -> id;
378379

379-
unsafe fn keysOfEntriesPassingTest_(self, predicate: *mut Block<(id, id, *mut BOOL), BOOL>) -> id;
380+
unsafe fn keysOfEntriesPassingTest_(self, predicate: *mut Block<(id, id, *mut Bool), Bool>) -> id;
380381
unsafe fn keysOfEntriesWithOptions_PassingTest_(self, opts: NSEnumerationOptions,
381-
predicate: *mut Block<(id, id, *mut BOOL), BOOL>) -> id;
382+
predicate: *mut Block<(id, id, *mut Bool), Bool>) -> id;
382383

383384
unsafe fn writeToFile_atomically_(self, path: id, flag: BOOL) -> BOOL;
384385
unsafe fn writeToURL_atomically_(self, aURL: id, flag: BOOL) -> BOOL;
@@ -481,12 +482,12 @@ impl NSDictionary for id {
481482
msg_send![self, objectEnumerator]
482483
}
483484

484-
unsafe fn enumerateKeysAndObjectsUsingBlock_(self, block: *mut Block<(id, id, *mut BOOL), ()>) {
485+
unsafe fn enumerateKeysAndObjectsUsingBlock_(self, block: *mut Block<(id, id, *mut Bool), ()>) {
485486
msg_send![self, enumerateKeysAndObjectsUsingBlock:block]
486487
}
487488

488489
unsafe fn enumerateKeysAndObjectsWithOptions_usingBlock_(self, opts: NSEnumerationOptions,
489-
block: *mut Block<(id, id, *mut BOOL), ()>) {
490+
block: *mut Block<(id, id, *mut Bool), ()>) {
490491
msg_send![self, enumerateKeysAndObjectsWithOptions:opts usingBlock:block]
491492
}
492493

@@ -503,12 +504,12 @@ impl NSDictionary for id {
503504
rv
504505
}
505506

506-
unsafe fn keysOfEntriesPassingTest_(self, predicate: *mut Block<(id, id, *mut BOOL), BOOL>) -> id {
507+
unsafe fn keysOfEntriesPassingTest_(self, predicate: *mut Block<(id, id, *mut Bool), Bool>) -> id {
507508
msg_send![self, keysOfEntriesPassingTest:predicate]
508509
}
509510

510511
unsafe fn keysOfEntriesWithOptions_PassingTest_(self, opts: NSEnumerationOptions,
511-
predicate: *mut Block<(id, id, *mut BOOL), BOOL>) -> id {
512+
predicate: *mut Block<(id, id, *mut Bool), Bool>) -> id {
512513
msg_send![self, keysOfEntriesWithOptions:opts PassingTest:predicate]
513514
}
514515

@@ -832,8 +833,8 @@ pub trait NSURL: Sized {
832833
unsafe fn initFileURLWithPath_(self, path: id) -> id;
833834
unsafe fn fileURLWithPathComponents_(_:Self, path_components: id /* (NSArray<NSString*>*) */) -> id;
834835
unsafe fn URLByResolvingAliasFileAtURL_options_error_(_:Self, url: id, options: NSURLBookmarkResolutionOptions, error: *mut id /* (NSError _Nullable) */) -> id;
835-
unsafe fn URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_(_:Self, data: id /* (NSData) */, options: NSURLBookmarkResolutionOptions, relative_to_url: id, is_stale: *mut BOOL, error: *mut id /* (NSError _Nullable) */) -> id;
836-
unsafe fn initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_(self, data: id /* (NSData) */, options: NSURLBookmarkResolutionOptions, relative_to_url: id, is_stale: *mut BOOL, error: *mut id /* (NSError _Nullable) */) -> id;
836+
unsafe fn URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_(_:Self, data: id /* (NSData) */, options: NSURLBookmarkResolutionOptions, relative_to_url: id, is_stale: *mut Bool, error: *mut id /* (NSError _Nullable) */) -> id;
837+
unsafe fn initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_(self, data: id /* (NSData) */, options: NSURLBookmarkResolutionOptions, relative_to_url: id, is_stale: *mut Bool, error: *mut id /* (NSError _Nullable) */) -> id;
837838
// unsafe fn fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_
838839
// unsafe fn getFileSystemRepresentation_maxLength_
839840
// unsafe fn initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_
@@ -955,10 +956,10 @@ impl NSURL for id {
955956
unsafe fn URLByResolvingAliasFileAtURL_options_error_(_:Self, url: id, options: NSURLBookmarkResolutionOptions, error: *mut id /* (NSError _Nullable) */) -> id {
956957
msg_send![class!(NSURL), URLByResolvingAliasFileAtURL:url options:options error:error]
957958
}
958-
unsafe fn URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_(_:Self, data: id /* (NSData) */, options: NSURLBookmarkResolutionOptions, relative_to_url: id, is_stale: *mut BOOL, error: *mut id /* (NSError _Nullable) */) -> id {
959+
unsafe fn URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_(_:Self, data: id /* (NSData) */, options: NSURLBookmarkResolutionOptions, relative_to_url: id, is_stale: *mut Bool, error: *mut id /* (NSError _Nullable) */) -> id {
959960
msg_send![class!(NSURL), URLByResolvingBookmarkData:data options:options relativeToURL:relative_to_url bookmarkDataIsStale:is_stale error:error]
960961
}
961-
unsafe fn initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_(self, data: id /* (NSData) */, options: NSURLBookmarkResolutionOptions, relative_to_url: id, is_stale: *mut BOOL, error: *mut id /* (NSError _Nullable) */) -> id {
962+
unsafe fn initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_(self, data: id /* (NSData) */, options: NSURLBookmarkResolutionOptions, relative_to_url: id, is_stale: *mut Bool, error: *mut id /* (NSError _Nullable) */) -> id {
962963
msg_send![self, initByResolvingBookmarkData:data options:options relativeToURL:relative_to_url bookmarkDataIsStale:is_stale error:error]
963964
}
964965
// unsafe fn fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_
@@ -1226,7 +1227,7 @@ pub trait NSData: Sized {
12261227

12271228
unsafe fn bytes(self) -> *const c_void;
12281229
unsafe fn description(self) -> id;
1229-
unsafe fn enumerateByteRangesUsingBlock_(self, block: *mut Block<(*const c_void, NSRange, *mut BOOL), ()>);
1230+
unsafe fn enumerateByteRangesUsingBlock_(self, block: *mut Block<(*const c_void, NSRange, *mut Bool), ()>);
12301231
unsafe fn getBytes_length_(self, buffer: *mut c_void, length: NSUInteger);
12311232
unsafe fn getBytes_range_(self, buffer: *mut c_void, range: NSRange);
12321233
unsafe fn subdataWithRange_(self, range: NSRange) -> id;
@@ -1305,7 +1306,7 @@ impl NSData for id {
13051306
msg_send![self, description]
13061307
}
13071308

1308-
unsafe fn enumerateByteRangesUsingBlock_(self, block: *mut Block<(*const c_void, NSRange, *mut BOOL), ()>) {
1309+
unsafe fn enumerateByteRangesUsingBlock_(self, block: *mut Block<(*const c_void, NSRange, *mut Bool), ()>) {
13091310
msg_send![self, enumerateByteRangesUsingBlock:block]
13101311
}
13111312

cocoa/src/appkit.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use block::Block;
1414
use foundation::{NSInteger, NSUInteger, NSTimeInterval,
1515
NSPoint, NSSize, NSRect, NSRange, NSRectEdge};
1616
use libc;
17+
use objc2::runtime::Bool;
1718

1819
pub use core_graphics::base::CGFloat;
1920
pub use core_graphics::geometry::CGPoint;
@@ -3251,7 +3252,7 @@ pub trait NSImage: Sized {
32513252
unsafe fn initWithPasteboard_(self, pasteboard: id /* (NSPasteboard *) */) -> id;
32523253
unsafe fn initWithSize_flipped_drawingHandler_(self, size: NSSize,
32533254
drawingHandlerShouldBeCalledWithFlippedContext: BOOL,
3254-
drawingHandler: *mut Block<(NSRect,), BOOL>);
3255+
drawingHandler: *mut Block<(NSRect,), Bool>);
32553256
unsafe fn initWithSize_(self, aSize: NSSize) -> id;
32563257

32573258
unsafe fn imageNamed_(_: Self, name: id /* (NSString *) */) -> id {
@@ -3345,7 +3346,7 @@ impl NSImage for id {
33453346

33463347
unsafe fn initWithSize_flipped_drawingHandler_(self, size: NSSize,
33473348
drawingHandlerShouldBeCalledWithFlippedContext: BOOL,
3348-
drawingHandler: *mut Block<(NSRect,), BOOL>) {
3349+
drawingHandler: *mut Block<(NSRect,), Bool>) {
33493350
msg_send![self, initWithSize:size
33503351
flipped:drawingHandlerShouldBeCalledWithFlippedContext
33513352
drawingHandler:drawingHandler]

0 commit comments

Comments
 (0)