Skip to content

Commit 7df583c

Browse files
committedAug 2, 2024
Dogfood
1 parent 32894e2 commit 7df583c

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed
 

‎std/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@
302302
#![feature(let_chains)]
303303
#![feature(link_cfg)]
304304
#![feature(linkage)]
305+
#![feature(macro_metavar_expr_concat)]
305306
#![feature(min_exhaustive_patterns)]
306307
#![feature(min_specialization)]
307308
#![feature(must_not_suspend)]

‎std/src/sys/pal/unix/weak.rs

+2-16
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,7 @@ pub(crate) macro syscall {
168168
if let Some(fun) = $name.get() {
169169
fun($($arg_name),*)
170170
} else {
171-
// This looks like a hack, but concat_idents only accepts idents
172-
// (not paths).
173-
use libc::*;
174-
175-
syscall(
176-
concat_idents!(SYS_, $name),
177-
$($arg_name),*
178-
) as $ret
171+
libc::syscall(libc::${concat(SYS_, $name)}, $($arg_name),*) as $ret
179172
}
180173
}
181174
)
@@ -185,14 +178,7 @@ pub(crate) macro syscall {
185178
pub(crate) macro raw_syscall {
186179
(fn $name:ident($($arg_name:ident: $t:ty),*) -> $ret:ty) => (
187180
unsafe fn $name($($arg_name:$t),*) -> $ret {
188-
// This looks like a hack, but concat_idents only accepts idents
189-
// (not paths).
190-
use libc::*;
191-
192-
syscall(
193-
concat_idents!(SYS_, $name),
194-
$($arg_name),*
195-
) as $ret
181+
libc::syscall(libc::${concat(SYS_, $name)}, $($arg_name),*) as $ret
196182
}
197183
)
198184
}

0 commit comments

Comments
 (0)
Please sign in to comment.