@@ -197,7 +197,7 @@ impl Arch {
197
197
}
198
198
}
199
199
200
- /// Returns the standard name of the architecture in the Linux world .
200
+ /// Returns the standard name of the architecture.
201
201
pub fn name ( & self ) -> & ' static str {
202
202
match self {
203
203
Self :: Aarch64 => "aarch64" ,
@@ -216,64 +216,22 @@ impl Arch {
216
216
}
217
217
}
218
218
219
- /// Returns the standard name of the architecture in the FreeBSD world, if it differs from the
220
- /// Linux name.
221
- pub fn freebsd_name ( & self ) -> Option < & ' static str > {
219
+ /// Represents the hardware platform.
220
+ ///
221
+ /// This is the same as the native platform's `uname -m` output.
222
+ ///
223
+ /// Based on: <https://github.com/PyO3/maturin/blob/8ab42219247277fee513eac753a3e90e76cd46b9/src/target/mod.rs#L131>
224
+ pub fn machine ( & self ) -> & ' static str {
222
225
match self {
223
- Self :: Aarch64 => None ,
224
- Self :: Armv5TEL => Some ( "armv5" ) ,
225
- Self :: Armv6L => Some ( "armv6" ) ,
226
- Self :: Armv7L => Some ( "armv7" ) ,
227
- Self :: Powerpc64Le => Some ( "powerpc64le" ) ,
228
- Self :: Powerpc64 => Some ( "powerpc64" ) ,
229
- Self :: Powerpc => Some ( "powerpc" ) ,
230
- Self :: X86 => Some ( "i386" ) ,
231
- Self :: X86_64 => Some ( "amd64" ) ,
232
- Self :: S390X => None ,
233
- Self :: LoongArch64 => None ,
234
- Self :: Riscv64 => None ,
235
- Self :: Wasm32 => None ,
236
- }
237
- }
238
-
239
- /// Returns the standard name of the architecture in the NetBSD world, if it differs from the
240
- /// Linux name.
241
- pub fn netbsd_name ( & self ) -> Option < & ' static str > {
242
- match self {
243
- Self :: Aarch64 => None ,
244
- Self :: Armv5TEL => Some ( "armv5" ) ,
245
- Self :: Armv6L => Some ( "armv6" ) ,
246
- Self :: Armv7L => Some ( "armv7" ) ,
247
- Self :: Powerpc64Le => Some ( "powerpc64le" ) ,
248
- Self :: Powerpc64 => Some ( "powerpc64" ) ,
249
- Self :: Powerpc => Some ( "powerpc" ) ,
250
- Self :: X86 => Some ( "i386" ) ,
251
- Self :: X86_64 => Some ( "amd64" ) ,
252
- Self :: S390X => None ,
253
- Self :: LoongArch64 => None ,
254
- Self :: Riscv64 => None ,
255
- Self :: Wasm32 => None ,
256
- }
257
- }
258
-
259
-
260
- /// Returns the standard name of the architecture in the FreeBSD world, if it differs from the
261
- /// Linux name.
262
- pub fn openbsd_name ( & self ) -> Option < & ' static str > {
263
- match self {
264
- Self :: Aarch64 => Some ( "arm64" ) ,
265
- Self :: Armv5TEL => Some ( "armv5" ) ,
266
- Self :: Armv6L => Some ( "armv6" ) ,
267
- Self :: Armv7L => Some ( "armv7" ) ,
268
- Self :: Powerpc64Le => Some ( "powerpc64le" ) ,
269
- Self :: Powerpc64 => Some ( "powerpc64" ) ,
270
- Self :: Powerpc => Some ( "powerpc" ) ,
271
- Self :: X86 => Some ( "i386" ) ,
272
- Self :: X86_64 => Some ( "amd64" ) ,
273
- Self :: S390X => None ,
274
- Self :: LoongArch64 => None ,
275
- Self :: Riscv64 => None ,
276
- Self :: Wasm32 => None ,
226
+ Arch :: Aarch64 => "arm64" ,
227
+ Arch :: Armv5TEL | Arch :: Armv6L | Arch :: Armv7L => "arm" ,
228
+ Arch :: Powerpc | Arch :: Powerpc64Le | Arch :: Powerpc64 => "powerpc" ,
229
+ Arch :: X86 => "i386" ,
230
+ Arch :: X86_64 => "amd64" ,
231
+ Arch :: Riscv64 => "riscv" ,
232
+ Arch :: Wasm32 => "wasm32" ,
233
+ Arch :: S390X => "s390x" ,
234
+ Arch :: LoongArch64 => "loongarch64" ,
277
235
}
278
236
}
279
237
}
0 commit comments