Skip to content

Commit 44e8bf8

Browse files
committed
Add a few more links to external documentation
1 parent 9f761ff commit 44e8bf8

File tree

6 files changed

+18
-4
lines changed

6 files changed

+18
-4
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,8 @@ jobs:
584584
ASMFLAGS: ${{ matrix.cflags }}
585585
LDFLAGS: ${{ matrix.cflags }}
586586
ARGS: --no-default-features --features=std,${{ matrix.runtime }}
587+
# http://wiki.gnustep.org/index.php/Building_GNUstep_under_Debian_FreeBSD#installing_gnustep-make
588+
RUNTIME_VERSION: gnustep-${{ matrix.libobjc2 }}
587589

588590
steps:
589591
- uses: actions/checkout@v3

crates/header-translator/src/rust_type.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ impl AttributeParser<'_, '_> {
122122
}
123123
}
124124

125+
/// We completely ignore `__kindof` in Rust as it is done in Swift, since
126+
/// it only exists to allow legacy Objective-C code to continue compiling.
127+
///
128+
/// See <https://lapcatsoftware.com/articles/kindof.html>
125129
fn is_kindof(&mut self, position: ParsePosition) -> bool {
126130
self.strip("__kindof", position)
127131
}

crates/objc-sys/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ fn main() {
171171
// The fragile runtime is expected on i686-apple-darwin, see:
172172
// https://github.com/llvm/llvm-project/blob/release/13.x/clang/lib/Driver/ToolChains/Darwin.h#L228-L231
173173
// https://github.com/llvm/llvm-project/blob/release/13.x/clang/lib/Driver/ToolChains/Clang.cpp#L3639-L3640
174+
// https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtVersionsPlatforms.html
174175
(MacOS(version), "x86") => format!("macosx-fragile-{version}"),
175176
(MacOS(version), _) => format!("macosx-{version}"),
176177
(IOS(version), _) => format!("ios-{version}"),

crates/objc-sys/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
//!
33
//! These bindings contain almost no documentation, so it is highly
44
//! recommended to read the documentation of the original libraries:
5-
//! - Apple's [official documentation][apple].
5+
//! - Apple's [documentation about the Objective-C runtime][runtime-guide].
6+
//! - Apple's [runtime reference][apple].
67
//! - Apple's `objc4` [source code][objc4], in particular `runtime.h`.
78
//! - GNUStep's `libobjc2` [source code][libobjc2], in particular `runtime.h`.
89
//!
910
//! See also the [`README.md`](https://crates.io/crates/objc-sys) for more
1011
//! background information, and for how to configure the desired runtime.
1112
//!
13+
//! [runtime-guide]: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Introduction/Introduction.html
1214
//! [apple]: https://developer.apple.com/documentation/objectivec/objective-c_runtime?language=objc
1315
//! [libobjc2]: https://github.com/gnustep/libobjc2/tree/v2.1/objc
1416
//! [objc4]: https://github.com/apple-oss-distributions/objc4

crates/objc-sys/src/various.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ extern_c_unwind! {
4545
extern_c! {
4646
#[cfg(any(doc, not(objfw)))]
4747
pub fn imp_getBlock(imp: IMP) -> *mut objc_object;
48+
// See also <https://landonf.org/code/objc/imp_implementationWithBlock.20110413.html>
4849
#[cfg(any(doc, not(objfw)))]
4950
pub fn imp_implementationWithBlock(block: *mut objc_object) -> IMP;
5051
#[cfg(any(doc, not(objfw)))]

crates/objc2/src/runtime/message_receiver.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ macro_rules! conditional_try {
3535
}};
3636
}
3737

38+
// More information on how objc_msgSend works:
39+
// <https://web.archive.org/web/20200118080513/http://www.friday.com/bbum/2009/12/18/objc_msgsend-part-1-the-road-map/>
40+
// <https://www.mikeash.com/pyblog/objc_msgsends-new-prototype.html>
41+
// <https://www.mikeash.com/pyblog/friday-qa-2012-11-16-lets-build-objc_msgsend.html>
3842
#[cfg(feature = "apple")]
3943
mod msg_send_primitive {
4044
#[allow(unused_imports)]
@@ -340,13 +344,13 @@ pub unsafe trait MessageReceiver: private::Sealed + Sized {
340344
/// Sends a message to the receiver with the given selector and arguments.
341345
///
342346
/// The correct version of `objc_msgSend` will be chosen based on the
343-
/// return type. For more information, see the section on "Sending
344-
/// Messages" in Apple's [documentation][runtime].
347+
/// return type. For more information, see [the Messaging section in
348+
/// Apple's Objective-C Runtime Programming Guide][guide-messaging].
345349
///
346350
/// If the selector is known at compile-time, it is recommended to use the
347351
/// [`msg_send!`] macro rather than this method.
348352
///
349-
/// [runtime]: https://developer.apple.com/documentation/objectivec/objective-c_runtime?language=objc
353+
/// [guide-messaging]: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtHowMessagingWorks.html
350354
///
351355
///
352356
/// # Safety

0 commit comments

Comments
 (0)