|
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 |
| -/// object! { |
| 48 | +/// extern_class! { |
49 | 49 | /// /// An example description.
|
50 | 50 | /// #[derive(PartialEq, Eq, Hash)] // Uses `NSObject`'s implementation
|
51 | 51 | /// // Specify class and superclass
|
|
64 | 64 | /// declared previously to specify as its superclass.
|
65 | 65 | ///
|
66 | 66 | /// ```
|
67 |
| -/// use objc2_foundation::{object, NSObject}; |
| 67 | +/// use objc2_foundation::{extern_class, NSObject}; |
68 | 68 | /// #
|
69 |
| -/// # object! { |
| 69 | +/// # extern_class! { |
70 | 70 | /// # #[derive(PartialEq, Eq, Hash)]
|
71 | 71 | /// # unsafe pub struct NSFormatter: NSObject;
|
72 | 72 | /// # }
|
73 | 73 | ///
|
74 |
| -/// object! { |
| 74 | +/// extern_class! { |
75 | 75 | /// #[derive(PartialEq, Eq, Hash)]
|
76 | 76 | /// // Specify the correct inheritance chain
|
77 | 77 | /// // `NSDateFormatter` subclasses `NSFormatter` which subclasses `NSObject`
|
|
81 | 81 | ///
|
82 | 82 | /// See the source code of `objc2_foundation` in general for more examples.
|
83 | 83 | #[macro_export]
|
84 |
| -macro_rules! object { |
| 84 | +macro_rules! extern_class { |
85 | 85 | (
|
86 | 86 | $(#[$m:meta])*
|
87 | 87 | unsafe $v:vis struct $name:ident: $($inheritance_chain:ty),+;
|
88 | 88 | ) => {
|
89 |
| - $crate::__inner_object! { |
| 89 | + $crate::__inner_extern_class! { |
90 | 90 | @__inner
|
91 | 91 | $(#[$m])*
|
92 | 92 | unsafe $v struct $name<>: $($inheritance_chain,)+ $crate::objc2::runtime::Object {}
|
@@ -143,15 +143,15 @@ macro_rules! __impl_as_ref_borrow {
|
143 | 143 |
|
144 | 144 | #[doc(hidden)]
|
145 | 145 | #[macro_export]
|
146 |
| -macro_rules! __inner_object { |
| 146 | +macro_rules! __inner_extern_class { |
147 | 147 | // TODO: Expose this variant in the `object` macro.
|
148 | 148 | (
|
149 | 149 | $(#[$m:meta])*
|
150 | 150 | unsafe $v:vis struct $name:ident<$($t:ident $(: $b:ident)?),*>: $($inheritance_chain:ty),+ {
|
151 | 151 | $($p:ident: $pty:ty,)*
|
152 | 152 | }
|
153 | 153 | ) => {
|
154 |
| - $crate::__inner_object! { |
| 154 | + $crate::__inner_extern_class! { |
155 | 155 | @__inner
|
156 | 156 | $(#[$m])*
|
157 | 157 | unsafe $v struct $name<$($t $(: $b)?),*>: $($inheritance_chain,)+ $crate::objc2::runtime::Object {
|
|
0 commit comments