|
43 | 43 | /// ```
|
44 | 44 | /// use objc2::msg_send_id;
|
45 | 45 | /// use objc2::rc::{Id, Shared};
|
46 |
| -/// use objc2_foundation::{object, NSObject}; |
| 46 | +/// use objc2_foundation::{extern_class, NSObject}; |
47 | 47 | /// #
|
48 | 48 | /// # #[cfg(feature = "gnustep-1-7")]
|
49 | 49 | /// # unsafe { objc2::__gnustep_hack::get_class_to_force_linkage() };
|
50 | 50 | ///
|
51 |
| -/// object! { |
| 51 | +/// extern_class! { |
52 | 52 | /// /// An example description.
|
53 | 53 | /// #[derive(PartialEq, Eq, Hash)] // Uses `NSObject`'s implementation
|
54 | 54 | /// // Specify class and superclass
|
|
67 | 67 | /// declared previously to specify as its superclass.
|
68 | 68 | ///
|
69 | 69 | /// ```
|
70 |
| -/// use objc2_foundation::{object, NSObject}; |
| 70 | +/// use objc2_foundation::{extern_class, NSObject}; |
71 | 71 | /// #
|
72 |
| -/// # object! { |
| 72 | +/// # extern_class! { |
73 | 73 | /// # #[derive(PartialEq, Eq, Hash)]
|
74 | 74 | /// # unsafe pub struct NSFormatter: NSObject;
|
75 | 75 | /// # }
|
76 | 76 | ///
|
77 |
| -/// object! { |
| 77 | +/// extern_class! { |
78 | 78 | /// #[derive(PartialEq, Eq, Hash)]
|
79 | 79 | /// // Specify the correct inheritance chain
|
80 | 80 | /// // `NSDateFormatter` subclasses `NSFormatter` which subclasses `NSObject`
|
|
84 | 84 | ///
|
85 | 85 | /// See the source code of `objc2_foundation` in general for more examples.
|
86 | 86 | #[macro_export]
|
87 |
| -macro_rules! object { |
| 87 | +macro_rules! extern_class { |
88 | 88 | (
|
89 | 89 | $(#[$m:meta])*
|
90 | 90 | unsafe $v:vis struct $name:ident: $($inheritance_chain:ty),+;
|
91 | 91 | ) => {
|
92 |
| - $crate::__inner_object! { |
| 92 | + $crate::__inner_extern_class! { |
93 | 93 | @__inner
|
94 | 94 | $(#[$m])*
|
95 | 95 | unsafe $v struct $name<>: $($inheritance_chain,)+ $crate::objc2::runtime::Object {}
|
@@ -146,15 +146,15 @@ macro_rules! __impl_as_ref_borrow {
|
146 | 146 |
|
147 | 147 | #[doc(hidden)]
|
148 | 148 | #[macro_export]
|
149 |
| -macro_rules! __inner_object { |
| 149 | +macro_rules! __inner_extern_class { |
150 | 150 | // TODO: Expose this variant in the `object` macro.
|
151 | 151 | (
|
152 | 152 | $(#[$m:meta])*
|
153 | 153 | unsafe $v:vis struct $name:ident<$($t:ident $(: $b:ident)?),*>: $($inheritance_chain:ty),+ {
|
154 | 154 | $($p:ident: $pty:ty,)*
|
155 | 155 | }
|
156 | 156 | ) => {
|
157 |
| - $crate::__inner_object! { |
| 157 | + $crate::__inner_extern_class! { |
158 | 158 | @__inner
|
159 | 159 | $(#[$m])*
|
160 | 160 | unsafe $v struct $name<$($t $(: $b)?),*>: $($inheritance_chain,)+ $crate::objc2::runtime::Object {
|
|
0 commit comments