| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
There was a missing period and the word "features" instead of "feature" in the section about `const extern fn`s.
|
|
|
|
| |
In the `no-std` section of the README, there was a typo: "disable this feature remove the dependency". The word "to" was added in this commit to create "disable this feature to remove this dependency".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DevkitPPC does not support unix sockets natively, meaning that bindings
to these functions was removed for powerpc targets with "nintendo" as
vendor.
Suggested target json files:
Nintendo Gamecube:
```
{
"arch": "powerpc",
"data-layout": "E-m:e-p:32:32-i64:64-n32",
"dynamic-linking": false,
"env": "newlib",
"executables": true,
"has-elf-tls": false,
"has-rpath": true,
"linker-flavor": "gcc",
"llvm-target": "powerpc-eabi",
"max-atomic-width": 32,
"os": "dolphin",
"target-c-int-width": "32",
"target-endian": "big",
"target-family": "unix",
"target-mcount": "_mcount",
"target-pointer-width": "32",
"vendor": "nintendo"
}
```
Nintendo Wii:
```
{
"arch": "powerpc",
"data-layout": "E-m:e-p:32:32-i64:64-n32",
"dynamic-linking": false,
"env": "newlib",
"executables": true,
"has-elf-tls": false,
"has-rpath": true,
"linker-flavor": "gcc",
"llvm-target": "powerpc-eabi",
"max-atomic-width": 32,
"os": "revolution",
"target-c-int-width": "32",
"target-endian": "big",
"target-family": "unix",
"target-mcount": "_mcount",
"target-pointer-width": "32",
"vendor": "nintendo"
}
```
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add support for making functions `const`
PR https://github.com/rust-lang/rust/pull/64906 adds the ability to write `const extern fn` and `const unsafe extern fn`, which will allow manys functions in `libc` to become `const`.
This is particuarly useful for functions which correspond to C macros (e.g. `CMSG_SPACE`). In C, these macros are constant expressions, allowing them to be used when declaring arrays. However, since the corresponding `libc` functions are not `const`, writing equivalent Rust code is impossible. Users must either perform an unecessary heap allocation, or pull in `bindgen` to evaluate the macro for specific values (e.g. `CMSG_SPACE(1)`).
However, the syntax `const extern fn` is not currently parsed by rust. To allow libc to use this without breaking backwards compatibility (i.e. bumping the minimum Rust version), I've taken the following approach:
1. A new off-by-default feature `extern-const-fn` is added to `libc`.
2. The internal `f!` macro has two versions, selected at compile-time by a `cfg_if`. When `extern-const-fn` is enabled, the declared `f!` macro passes through the `const` keyword from the macro user to the final definition (`pub const unsafe extern fn foo`. When `extern-const-fn` is disabled, the `const` keyword passed by the macro user is discarded, resulting in a plain `pub extern const fn` being declared.
Unfortunately, I couldn't manage to get `macro_rules` to accept a normal `const` token in the proper place (after `pub`). I had to resort to placing it in curly brackets:
```rust
pub {const} fn foo(val: u8) -> i8 {
}
```
The `f!` macro then translates this to a function definition with `const` in the proper position.
I'd appreciate it if someone who's more familiar with `macro_rules!` could see if I missed a way to get the desired syntax.
|
| |
| |
| |
| |
| | |
Add a new feature to enable this, since `const extern fn`
support is unstable
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Related to #657 .
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
See if it works with Cirrus CI!
|
|
|
|
| |
Reported-by: Alex Zepeda
|
|
|
|
| |
Closes #651 .
|
| |
|
| |
|
|
|
| |
added Documentation, Latest Version, License badges similar to rand crate. https://crates.io/crates/rand
|
| |
|
|
|
|
|
| |
Add sparc64-unknown-linux-gnu and x86_64-sun-solaris.
Remove aarch64-unknown-linux-musl.
|
|
|
|
|
| |
Signed-off-by: Tom Kirchner <tjk@amazon.com>
Signed-off-by: Ben Cressey <bcressey@amazon.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now create an additional binary `linux_fcntl` for testing this
since there are header conflicts when including all necessary headers.
This binary is run on all platforms even though it's empty on all non-
Android/non-Linux platforms.
Testing has been switched from a custom binary to using a runner-less
test (or pair of tests). This means that for local development a simple
`cd libc-test && cargo test` will run all the tests. CI has also been
updated here to reflect that.
|
|
|
|
| |
Anyone can do it!
|
| |
|
| |
|
|
|
|
|
| |
* Rework of original patches from Niels Sascha Reedijk
that include style and build fixes for libc master
|
|
|
|
|
|
|
|
|
| |
in order to advise contributors to locally test their patches.
Also update ctest to include a fix on rerun-if-changed so that human
developers doing trial & error can properly test their latest code.
Signed-off-by: NODA, Kai <nodakai@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This adds a `use_std` Cargo feature which disables `#![no_std]` builds of libc,
but is enabled by default. The library will currently continue to link to the
standard library to maintain backwards compatibility with the 0.2 series and
older Rust compilers for now, but this default can possible be changed in the
future.
|
|
|
|
| |
Now we're testing rumprun, openbsd, and freebsd
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|