History log of /rust-libc-0.2.174/src/macros.rs (Results 1 – 25 of 48)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: 0.2.174, 0.2.173
# c04c92ed 02-Jun-2025 Trevor Gross <[email protected]>

Replace handwritten `Debug` impls with derives

`s_no_extra_traits!` doesn't derive `Debug` so there are a lot of
handwritten implementations. However, since we have a derive-like
solution for unions

Replace handwritten `Debug` impls with derives

`s_no_extra_traits!` doesn't derive `Debug` so there are a lot of
handwritten implementations. However, since we have a derive-like
solution for unions now (printing them like an opaque struct), there
really isn't any reason these can't all be derived.

Add `derive(Debug)` to `s_no_extra_traits`, still gated behind `feature
= "extra_traits"`, which allows getting rid of manual implementations.

(backport <https://github.com/rust-lang/libc/pull/4471>)
(cherry picked from commit 65c39bf1b0c7b904cf512280860120307d17703b)

show more ...


# f1e6e15c 15-Apr-2025 Trevor Gross <[email protected]>

Introduce a new `c_enum` macro

Our current `e!` macro makes it easy to run into UB if C headers add a
variant that isn't represented in the Rust version. Add a path to
migrate away from this by intr

Introduce a new `c_enum` macro

Our current `e!` macro makes it easy to run into UB if C headers add a
variant that isn't represented in the Rust version. Add a path to
migrate away from this by introducing the `c_enum!` macro which
represents a C enum as Rust constants and a type alias.

Part of [1].

[1]: https://github.com/rust-lang/libc/issues/4419

(backport <https://github.com/rust-lang/libc/pull/4420>)
(cherry picked from commit 62051ca277a78d9af4912d7957fa5ce3611183a0)

show more ...


Revision tags: 0.2.172, ctest-v0.4.11, ctest-v0.4.10, 0.2.171, 0.2.170
# ba11cc0d 27-Jan-2025 Trevor Gross <[email protected]>

Fix the `missing_abi` lint

Recent versions of Rust require the ABI always be specified for `extern`
functions, whereas it historically defaulted to `extern "C"`. Fix a few
cases where this lint now

Fix the `missing_abi` lint

Recent versions of Rust require the ABI always be specified for `extern`
functions, whereas it historically defaulted to `extern "C"`. Fix a few
cases where this lint now gets raised by specifying `extern "C"`.

(backport <https://github.com/rust-lang/libc/pull/4254>)
(cherry picked from commit c9a71dc2d31b73c00091a4082c1e989cee79f792)

show more ...


Revision tags: 0.2.169, 0.2.168
# 7457aa18 07-Dec-2024 Juan Aguilar Santillana <[email protected]>

fix: make Debug impl for unions opaque

(backport <https://github.com/rust-lang/libc/pull/4176>)
(cherry picked from commit 6faa521f32fc11db9fc43a248a64463ce288b48d)

[ resolve conflicts and update b

fix: make Debug impl for unions opaque

(backport <https://github.com/rust-lang/libc/pull/4176>)
(cherry picked from commit 6faa521f32fc11db9fc43a248a64463ce288b48d)

[ resolve conflicts and update based on some main vs. 0.2 differences -
Trevor ]

show more ...


Revision tags: ctest-v0.4.9, 0.2.167
# 4ca22fa9 27-Nov-2024 Trevor Gross <[email protected]>

Fix the build with `rustc-dep-of-std`

Since [1] we use derive macros rather than manually implementing `Clone`
and `Copy`. However, this caused the build in `std` to start failing
since the `core` p

Fix the build with `rustc-dep-of-std`

Since [1] we use derive macros rather than manually implementing `Clone`
and `Copy`. However, this caused the build in `std` to start failing
since the `core` prelude is not available. This provides the derive
macros as well as `derive` itself.

Resolve this by using complete paths. Additionally allow
`internal_features` to suppress the warning using `link_cfg`, and change
to using global paths for all uses of `core`.

Link: https://github.com/rust-lang/libc/pull/4038 [1]

(backport <https://github.com/rust-lang/libc/pull/4158>)
(cherry picked from commit d69ad56bd8c12329780739d42f9ed8392814595b)

show more ...


# 877b6f6e 27-Nov-2024 Trevor Gross <[email protected]>

Create an internal prelude

When building with `rustc-dep-of-std`, we don't get the core types
imported by default (`Clone`, `Copy`, `Option`). In order to avoid
needing to import these individually,

Create an internal prelude

When building with `rustc-dep-of-std`, we don't get the core types
imported by default (`Clone`, `Copy`, `Option`). In order to avoid
needing to import these individually, introduce a prelude that includes
them, along with commonly used C numeric types.

This allows cleaning up some of the `use` statements.

(backport <https://github.com/rust-lang/libc/pull/4161>)
(cherry picked from commit 30bc78b2ccc2d620cdd1f2ac16be083eff6dcabc)

show more ...


Revision tags: 0.2.166
# 5d2b17f3 26-Nov-2024 Trevor Gross <[email protected]>

fix: Ensure that `const extern fn` is always enabled

In [1] this conditional was dropped in favor of a Cargo feature, which
was turned on by default in [2]. However, this did not help the case
where

fix: Ensure that `const extern fn` is always enabled

In [1] this conditional was dropped in favor of a Cargo feature, which
was turned on by default in [2]. However, this did not help the case
where `--no-default-features` is passed.

Unfortunately we still can't drop this config entirely since `ctest`
cannot parse the syntax, so change back to useing a `cfg` to control
constness rather than a Cargo feature.

Additionally, remove a portion of the macro's comment that is no longer
relevant.

Fixes: https://github.com/rust-lang/libc/issues/4149

[1]: https://github.com/rust-lang/libc/pull/4105
[2]: https://github.com/rust-lang/libc/pull/4134

(backport <https://github.com/rust-lang/libc/pull/4151>)
(cherry picked from commit e18ee8cd96e400291ca488ca879edeb27c8b1d73)

show more ...


Revision tags: 0.2.165
# e103585a 20-Nov-2024 Trevor Gross <[email protected]>

Change from `$(,)?` to `$(,)*` for ctest

`ctest` sometimes reports a parsing failure but it isn't consistent (I
do not know why). Just use a less ideal older syntax for now, this is an
internal macr

Change from `$(,)?` to `$(,)*` for ctest

`ctest` sometimes reports a parsing failure but it isn't consistent (I
do not know why). Just use a less ideal older syntax for now, this is an
internal macro.

(backport <https://github.com/rust-lang/libc/pull/4120>)
(cherry picked from commit 27ad99414328a0589edf9b0b86792004dcb6925f)

show more ...


# 92c198cc 19-Nov-2024 Trevor Gross <[email protected]>

Adjust the `f!` macro to be more flexible

Currently this only matches `$body` if every line ends with a semicolon.
Make this simpler by just using the `block` matcher.

Additionally, allow a trailin

Adjust the `f!` macro to be more flexible

Currently this only matches `$body` if every line ends with a semicolon.
Make this simpler by just using the `block` matcher.

Additionally, allow a trailing comma.

(backport <https://github.com/rust-lang/libc/pull/4107>)
(cherry picked from commit 0ac42fd3d32f1719cb185cfafceaceff13a5195e)

show more ...


# 602f0395 18-Nov-2024 Trevor Gross <[email protected]>

Small syncs from `main` to `libc-0.2`


Revision tags: 0.2.164, 0.2.163
# 269e9f53 15-Nov-2024 Andy Caldwell <[email protected]>

Use `#[derive]` for `Copy`/`Clone` in `s!` and friends.

Allows use of `#[cfg]` to skip items in an `s!` block without creating
invalid, orphaned `impl` blocks.

(backport <https://github.com/rust-la

Use `#[derive]` for `Copy`/`Clone` in `s!` and friends.

Allows use of `#[cfg]` to skip items in an `s!` block without creating
invalid, orphaned `impl` blocks.

(backport <https://github.com/rust-lang/libc/pull/4038>)
(cherry picked from commit 44c548d00a68feebf80ebc919f3964d9330cc668)

show more ...


# 674cc1f4 16-Nov-2024 Trevor Gross <[email protected]>

Drop the `libc_const_extern_fn` conditional

Additionally deprecate the `const-extern-fn` feature. This is possible
since the MSRV was increased to 1.63.


# 8a4aedba 17-Nov-2024 Trevor Gross <[email protected]>

Make macros.rs more similar to what is on `main`


# 85eac5f1 16-Nov-2024 Trevor Gross <[email protected]>

Drop the `ptr_addr_of` conditional

This is possible since increasing the MSRV to 1.63


Revision tags: 0.2.162, 0.2.161, 0.2.160, 0.2.159, 0.2.158, 0.2.157, 0.2.156, 0.2.155, 0.2.154, ctest-v0.4.8, 0.2.153, 0.2.152, 0.2.151, 0.2.150, 0.2.149, 0.2.148, 0.2.147, ctest-v0.4.7, 0.2.146, 0.2.145, 0.2.144, 0.2.143, ctest-v0.4.6, 0.2.142, 0.2.141, 0.2.140, 0.2.139, 0.2.138, ctest-v0.4.5, 0.2.137, 0.2.136, 0.2.135, 0.2.134, 0.2.133, 0.2.132, 0.2.131, 0.2.130, 0.2.129, 0.1.128, 0.2.128, 0.2.127
# b5b553d0 12-Jul-2022 Trevor Gross <[email protected]>

Require rust >= 1.25 and drop libc_align conditional

This is mostly taken from Josh's work at [1], I just updated to account
for conflicts and new uses of `libc_align`.

[1]: https://github.com/rust

Require rust >= 1.25 and drop libc_align conditional

This is mostly taken from Josh's work at [1], I just updated to account
for conflicts and new uses of `libc_align`.

[1]: https://github.com/rust-lang/libc/pull/2845

Co-authored-by: Josh Triplett <[email protected]>

show more ...


# b9e4d801 12-Jul-2022 Trevor Gross <[email protected]>

Require rust >= 1.19 and drop libc_union conditional

This is mostly taken from Josh's work at
<https://github.com/rust-lang/libc/pull/2845>. I just updated to remove
all new uses of `libc_union` int

Require rust >= 1.19 and drop libc_union conditional

This is mostly taken from Josh's work at
<https://github.com/rust-lang/libc/pull/2845>. I just updated to remove
all new uses of `libc_union` introduced since then.

Co-authored-by: Josh Triplett <[email protected]>

show more ...


# a693257d 28-Nov-2023 Samuel Tardieu <[email protected]>

Do not dereference uninhabited types refs in Clone implementations

A reference to an uninhabited type should never be dereferenced:
this is UB. `Copy` should not be implemented on such a type, and
a

Do not dereference uninhabited types refs in Clone implementations

A reference to an uninhabited type should never be dereferenced:
this is UB. `Copy` should not be implemented on such a type, and
an upcoming Clippy lint (`uninhabited_reference`) may flag such
dereferences as suspicious.

Since those types are not structs, they do not need to get `Copy`
and `Clone` implementations. A `missing!` macro limits code
duplication.

show more ...


# d55d5930 23-May-2022 Amanieu d'Antras <[email protected]>

Clean up lints around unused macros


Revision tags: 0.2.126
# b3b81a7a 16-May-2022 Amanieu d'Antras <[email protected]>

Allow unused macro rules


Revision tags: ctest-v0.4.4, 0.2.125, 0.2.124, 0.2.123, 0.2.122, 0.2.121, 0.2.120, 0.2.119, 0.2.118, 0.2.117, 0.2.116, 0.2.115, 0.2.114, 0.2.113, 0.2.112, 0.2.111, 0.2.110, 0.2.109, ctest-v0.4.3, 0.2.108
# efc0a9eb 16-Nov-2021 Yuki Okushi <[email protected]>

Suggest the `mach2` crate instead


Revision tags: 0.2.107
# cd57a938 02-Nov-2021 Noa <[email protected]>

Use ptr::addr_of when available


Revision tags: 0.2.106, 0.2.105, ctest-v0.4.2, 0.2.104, 0.2.103, 0.2.102, 0.2.101, 0.2.100, 0.2.99, 0.2.98, 0.2.97, 0.2.96, 0.2.95, ctest-v0.4.1, 0.2.94, 0.2.93, 0.2.92, 0.2.91, 0.2.90, 0.2.89, 0.2.88, 0.2.87, 0.2.86, 0.2.85, 0.2.84, ctest-v0.4.0, 0.2.83, 0.2.82, 0.2.81, 0.2.80
# ae193eaa 25-Oct-2020 Yuki Okushi <[email protected]>

Allow attributes in `f!` and related macros


# d73e8a3d 16-Oct-2020 Eduardo Sánchez Muñoz <[email protected]>

af_alg_iv: Move the deprecated attribute to the struct definition and specify version.


Revision tags: 0.2.79, 0.2.78, 0.2.77, 0.2.76
# 5a1df22a 20-Aug-2020 Josh Triplett <[email protected]>

Make some inline functions like WIFEXITED and WEXITSTATUS const and safe


Revision tags: 0.2.75, 0.2.74
# 2d5fc451 27-Jul-2020 Glenn Hope <[email protected]>

Create macros for defining Copy and Clone on psp's enums and parenthetical structs

Fix styling

Re-run CI


12