Skip to content

Commit bffd0db

Browse files
committed
Remove lower-version clang workarounds
1 parent 94d8ac1 commit bffd0db

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

crates/header-translator/framework-includes.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
// Workaround for clang < 13, only used in NSBundle.h
2-
#define NS_FORMAT_ARGUMENT(A)
3-
4-
// Workaround for clang < 13
5-
#define _Nullable_result _Nullable
6-
71
#include <TargetConditionals.h>
82

93
#if TARGET_OS_OSX

crates/header-translator/src/rust_type.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ impl AttributeParser<'_, '_> {
141141
None
142142
}
143143
}
144+
145+
fn nullable_result(&mut self, position: ParsePosition) -> bool {
146+
self.strip("_Nullable_result", position)
147+
}
144148
}
145149

146150
impl Drop for AttributeParser<'_, '_> {
@@ -584,6 +588,10 @@ impl Inner {
584588

585589
let is_const = get_is_const(parser.is_const(ParsePosition::Suffix));
586590
lifetime.update(parser.lifetime(ParsePosition::Suffix));
591+
592+
// TODO: Use _Nullable_result
593+
let _nullable_result = parser.nullable_result(ParsePosition::Suffix);
594+
587595
let nullability = if let Some(nullability) = unexposed_nullability {
588596
nullability
589597
} else {
@@ -672,6 +680,10 @@ impl Inner {
672680

673681
let is_const = get_is_const(parser.is_const(ParsePosition::Suffix));
674682
lifetime.update(parser.lifetime(ParsePosition::Suffix));
683+
684+
// TODO: Use _Nullable_result
685+
let _nullable_result = parser.nullable_result(ParsePosition::Suffix);
686+
675687
let mut nullability = if let Some(nullability) = unexposed_nullability {
676688
nullability
677689
} else {

0 commit comments

Comments
 (0)