🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

libc

Package Overview
Dependencies
Maintainers
0
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libc - cargo Package Compare versions

Comparing version
0.2.165
to
0.2.166
+1
-1
.cargo_vcs_info.json
{
"git": {
"sha1": "575fa43c3a2c8217654e7f94c82e16c9ad05473a"
"sha1": "1e9ab864518b359fa4e50c22035111790ef2d483"
},
"path_in_vcs": ""
}

@@ -48,3 +48,3 @@ [workspace]

# Extract backport patterns
{ pattern = '\(backport <.*/(\d+)>\)', text = "#$1", href = "https://github.com/rust-lang/libc/pulls/$1"}
{ pattern = '\(backport <.*/(\d+)>\)', text = "#$1", href = "https://github.com/rust-lang/libc/pull/$1"}
]

@@ -16,2 +16,4 @@ use std::process::{Command, Output};

"freebsd15",
// FIXME(ctest): this config shouldn't be needed but ctest can't parse `const extern fn`
"libc_const_extern_fn",
"libc_deny_warnings",

@@ -84,2 +86,5 @@ "libc_thread_local",

// Set unconditionally when ctest is not being invoked.
set_cfg("libc_const_extern_fn");
// check-cfg is a nightly cargo/rustc feature to warn when unknown cfgs are used across the

@@ -86,0 +91,0 @@ // codebase. libc can configure it if the appropriate environment variable is passed. Since

@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

name = "libc"
version = "0.2.165"
version = "0.2.166"
authors = ["The Rust Project Developers"]

@@ -180,6 +180,3 @@ build = "build.rs"

const-extern-fn = []
default = [
"const-extern-fn",
"std",
]
default = ["std"]
extra_traits = []

@@ -186,0 +183,0 @@ rustc-dep-of-std = [

# Changelog
## [Unreleased]
## [0.2.166](https://github.com/rust-lang/libc/compare/0.2.165...0.2.166) - 2024-11-26
### Fixed
This release resolves two cases of unintentional breakage from the previous release:
- Revert removal of array size hacks [#4150](https://github.com/rust-lang/libc/pull/4150)
- Ensure `const extern` functions are always enabled [#4151](https://github.com/rust-lang/libc/pull/4151)
## [0.2.165](https://github.com/rust-lang/libc/compare/0.2.164...0.2.165) - 2024-11-25

@@ -5,0 +14,0 @@

@@ -170,29 +170,20 @@ /// A macro for defining #[cfg] if-else statements.

// This is a pretty horrible hack to allow us to conditionally mark
// some functions as 'const', without requiring users of this macro
// to care about the "const-extern-fn" feature.
// This is a pretty horrible hack to allow us to conditionally mark some functions as 'const',
// without requiring users of this macro to care "libc_const_extern_fn".
//
// When 'const-extern-fn' is enabled, we emit the captured 'const' keyword
// in the expanded function.
// When 'libc_const_extern_fn' is enabled, we emit the captured 'const' keyword in the expanded
// function.
//
// When 'const-extern-fn' is disabled, we always emit a plain 'pub unsafe extern fn'.
// When 'libc_const_extern_fn' is disabled, we always emit a plain 'pub unsafe extern fn'.
// Note that the expression matched by the macro is exactly the same - this allows
// users of this macro to work whether or not 'const-extern-fn' is enabled
// users of this macro to work whether or not 'libc_const_extern_fn' is enabled
//
// Unfortunately, we need to duplicate most of this macro between the 'cfg_if' blocks.
// This is because 'const unsafe extern fn' won't even parse on older compilers,
// so we need to avoid emitting it at all of 'const-extern-fn'.
// so we need to avoid emitting it at all of 'libc_const_extern_fn'.
//
// Specifically, moving the 'cfg_if' into the macro body will *not* work.
// Doing so would cause the '#[cfg(feature = "const-extern-fn")]' to be emitted
// into user code. The 'cfg' gate will not stop Rust from trying to parse the
// 'pub const unsafe extern fn', so users would get a compiler error even when
// the 'const-extern-fn' feature is disabled
//
// Note that users of this macro need to place 'const' in a weird position
// (after the closing ')' for the arguments, but before the return type).
// This was the only way I could satisfy the following two requirements:
// 1. Avoid ambiguity errors from 'macro_rules!' (which happen when writing '$foo:ident fn'
// 2. Allow users of this macro to mix 'pub fn foo' and 'pub const fn bar' within the same
// 'f!' block
// Specifically, moving the 'cfg_if' into the macro body will *not* work. Doing so would cause the
// '#[cfg(libc_const_extern_fn)]' to be emitted into user code. The 'cfg' gate will not stop Rust
// from trying to parse the 'pub const unsafe extern fn', so users would get a compiler error even
// when the 'libc_const_extern_fn' feature is disabled.

@@ -203,4 +194,4 @@ // FIXME(ctest): ctest can't handle `const extern` functions, we should be able to remove this

cfg_if! {
if #[cfg(feature = "const-extern-fn")] {
/// Define an `unsafe` function that is const as long as `const-extern-fn` is enabled.
if #[cfg(libc_const_extern_fn)] {
/// Define an `unsafe` function that is const as long as `libc_const_extern_fn` is enabled.
macro_rules! f {

@@ -219,3 +210,3 @@ ($(

/// Define a safe function that is const as long as `const-extern-fn` is enabled.
/// Define a safe function that is const as long as `libc_const_extern_fn` is enabled.
macro_rules! safe_f {

@@ -234,3 +225,3 @@ ($(

/// A nonpublic function that is const as long as `const-extern-fn` is enabled.
/// A nonpublic function that is const as long as `libc_const_extern_fn` is enabled.
macro_rules! const_fn {

@@ -249,3 +240,3 @@ ($(

} else {
/// Define an `unsafe` function that is const as long as `const-extern-fn` is enabled.
/// Define an `unsafe` function that is const as long as `libc_const_extern_fn` is enabled.
macro_rules! f {

@@ -264,3 +255,3 @@ ($(

/// Define a safe function that is const as long as `const-extern-fn` is enabled.
/// Define a safe function that is const as long as `libc_const_extern_fn` is enabled.
macro_rules! safe_f {

@@ -279,3 +270,3 @@ ($(

/// A nonpublic function that is const as long as `const-extern-fn` is enabled.
/// A nonpublic function that is const as long as `libc_const_extern_fn` is enabled.
macro_rules! const_fn {

@@ -282,0 +273,0 @@ ($(

@@ -520,3 +520,3 @@ pub type dev_t = u32;

__unused: [::c_uint; 8],
pub mc_fpregs: [::c_uint; 256],
pub mc_fpregs: [[::c_uint; 8]; 32],
}

@@ -523,0 +523,0 @@

@@ -169,3 +169,3 @@ // APIs that were changed after FreeBSD 11

/// Spare string space.
pub ki_sparestrings: [::c_char; 46],
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.

@@ -172,0 +172,0 @@ pub ki_spareints: [::c_int; ::KI_NSPARE_INT],

@@ -176,3 +176,3 @@ // APIs in FreeBSD 12 that have changed since 11.

/// Spare string space.
pub ki_sparestrings: [::c_char; 46],
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.

@@ -179,0 +179,0 @@ pub ki_spareints: [::c_int; ::KI_NSPARE_INT],

@@ -186,3 +186,3 @@ // APIs in FreeBSD 13 that have changed since 11.

/// Spare string space.
pub ki_sparestrings: [::c_char; 46],
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.

@@ -189,0 +189,0 @@ pub ki_spareints: [::c_int; ::KI_NSPARE_INT],

@@ -186,3 +186,3 @@ // APIs in FreeBSD 14 that have changed since 11.

/// Spare string space.
pub ki_sparestrings: [::c_char; 46],
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.

@@ -189,0 +189,0 @@ pub ki_spareints: [::c_int; ::KI_NSPARE_INT],

@@ -186,3 +186,3 @@ // APIs in FreeBSD 15 that have changed since 11.

/// Spare string space.
pub ki_sparestrings: [::c_char; 46],
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.

@@ -189,0 +189,0 @@ pub ki_spareints: [::c_int; ::KI_NSPARE_INT],

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display