Skip to content

Commit

Permalink
Add a test that the const extern fn macro works
Browse files Browse the repository at this point in the history
By default, any functions defined in this macro (such as `CMSG_SPACE`)
should be `const`.
  • Loading branch information
tgross35 committed Nov 25, 2024
1 parent e0c4e5b commit 0304ed5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/const_fn.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#[cfg(target_os = "linux")]
const _FOO: libc::c_uint = unsafe { libc::CMSG_SPACE(1) };
//^ if CMSG_SPACE is not const, this will fail to compile

0 comments on commit 0304ed5

Please sign in to comment.