Commit Graph

61 Commits

Author SHA1 Message Date
Josh Triplett 12725772cb README.md: Clarify (lack of) MSRV policy
MSRV policy is still being discussed on an ongoing basis in
https://github.com/rust-lang/libs-team/issues/72 . In the interim,
clarify in README that libc doesn't currently have an MSRV policy.
2022-07-26 11:38:58 -07:00
Yuki Okushi 52a706cd89 Enable libc_const_extern_fn implicitly from Rust 1.62 2022-06-08 17:42:05 +09:00
Yuki Okushi ccdd80d507 Replace all mentions about Pipelines with GHA 2021-01-28 18:29:32 +09:00
Yuki Okushi d39726ffce Replace CI badge 2020-10-15 21:02:07 +09:00
David Stroud bc8902a364 Fix more typos
There was a missing period and the word "features" instead of "feature" in the section about `const extern fn`s.
2020-09-30 11:24:50 -04:00
David Stroud 4ee8d4ac39 Fix typo
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".
2020-09-30 11:21:07 -04:00
Dark Kirb f54b58923c Add DevkitPPC support
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"
}
```
2020-08-05 08:19:48 +01:00
Yuki Okushi f696f6fc6f Tweak building documentation 2020-07-08 16:48:03 +09:00
Yuki Okushi 51f8130832 Put index.html using unstable rustdoc features 2020-07-08 08:26:07 +09:00
Yuki Okushi 07bc05549d Fix pipelines badge on README 2020-03-11 03:46:06 +09:00
bors c40d1a9d72 Auto merge of #1536 - Aaron1011:feature/const-fn, r=gnzlbg
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.
2019-11-18 19:37:32 +00:00
Aaron Hill 34e6812218 Add support for declaring 'const fn'
Add a new feature to enable this, since `const extern fn`
support is unstable
2019-10-27 20:59:38 -04:00
Alex Touchet 0592726790 Readme updates 2019-10-17 20:03:51 -07:00
gnzlbg 3f7673a603 Remove broken link 2019-10-17 15:38:54 +02:00
gnzlbg 893df8bd46 Update README Azure badge to rust-lang2 org 2019-08-12 10:15:35 +02:00
gnzlbg a636c69f65 Remove Appveyor 2019-07-27 13:25:22 +02:00
gnzlbg 51a153847a Setup Azure Pipelines 2019-07-27 13:25:22 +02:00
Jonathan Behrens d6a4c8f944 Fix link in README.md 2019-06-28 15:21:44 -04:00
gnzlbg fd239bec67 Deprecate use_std cargo feature: use std instead .
Related to #657 .
2019-05-24 13:22:03 +02:00
gnzlbg 9b9bc75cc1 Fix broken links in README 2019-02-21 10:18:06 +01:00
gnzlbg f0ceba18c4 Fix typo in README; do not generate .nojekyll file in gh-pages branch 2019-02-21 08:46:25 +01:00
gnzlbg 7f30f5f5ca Generate a proper landing page for the master docs 2019-02-13 14:48:50 +01:00
Arnav Borborah 5d03785cd3 Fix license badge 2019-02-08 20:22:24 -05:00
gnzlbg 56a6182c5c Align Rust-version support table of the README 2019-02-07 20:06:50 +01:00
gnzlbg f96532741e Document platform support in the README 2019-02-07 13:44:32 +01:00
Bryant Mairs dcc0560584 Implement Hash for all types 2019-02-02 16:32:00 -08:00
Bryant Mairs 1bab962ca6 Implement Debug for all types 2019-02-02 13:06:58 -08:00
Bryant Mairs 257a14a487 Implement PartialEq,Eq for all types 2019-02-02 13:06:58 -08:00
Alex Crichton 3d5d116b71 Test out new bors integration
See if it works with Cirrus CI!
2019-01-02 10:27:19 -08:00
Alan Somers 5ced940f0c [skip ci] Add a Cirrus-ci.com build badge
Reported-by: Alex Zepeda
2019-01-01 19:26:36 -07:00
gnzlbg 9b1b61c15e Use crates.io keywords and categories
Closes #651 .
2018-11-22 19:06:40 +01:00
gnzlbg 8efeb2c6c5 Factor out platforms for which libc is empty 2018-11-20 11:19:34 +01:00
Linus Färnstrand ca5dbcdf5e Describe the align feature in the readme 2018-07-30 16:57:55 +02:00
BC Ko 2603cb9689 added badges
added Documentation, Latest Version, License badges similar to rand crate. https://crates.io/crates/rand
2018-06-30 21:48:41 -07:00
Trevor Spiteri d852aad9b1 fix README.md links 2018-04-21 21:56:52 +02:00
bgermann 1e9f8de827 Edit documentation
Add sparc64-unknown-linux-gnu and x86_64-sun-solaris.
Remove aarch64-unknown-linux-musl.
2018-03-10 13:10:50 +01:00
Tom Kirchner b5bbdca7d1 Add support for aarch64-unknown-linux-musl
Signed-off-by: Tom Kirchner <tjk@amazon.com>
Signed-off-by: Ben Cressey <bcressey@amazon.com>
2017-09-25 14:30:52 -07:00
Bryant Mairs a511e52d1e Add more fcntl and seal constants for Android/Linux
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.
2017-08-20 20:52:43 -07:00
Alex Crichton b2418b1081 Add instructions of how to make a release
Anyone can do it!
2017-04-26 15:44:19 -07:00
Kevin Brothaler cd32da1259 Fixup target triple name 2017-01-17 21:38:37 -04:00
Corey Farwell d297f58691 Fix appveyor badge. 2016-11-26 13:49:49 -05:00
Niels Sascha Reedijk c17dcad60b Add support for Haiku x86 and x86_64
* Rework of original patches from Niels Sascha Reedijk
  that include style and build fixes for libc master
2016-09-29 14:00:57 -05:00
Kai Noda 8c532536ef Explain about the automated tests on Travis
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>
2016-04-27 08:35:18 +08:00
A.J. Gardner e4ec153b68 Remove iOS doc links from README 2016-04-02 18:41:19 -05:00
Alex Crichton 5def2f93d1 Update links in README for transition to rust-lang 2016-02-11 18:37:10 -08:00
Alex Crichton 34def53423 Add a default-on "use_std" feature
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.
2016-02-10 17:21:21 -08:00
Alex Crichton 26218e205a Linkify more docs, add more tested triples
Now we're testing rumprun, openbsd, and freebsd
2016-01-22 13:21:36 -08:00
Alex Crichton 57ba1fa360 Bump to 0.2.0 2015-11-03 13:23:16 -08:00
Alex Crichton bf26024b64 Update AppVeyor URL 2015-10-29 22:16:32 -07:00
Alex Crichton cf18a601c5 Not releasing 1.0 yet 2015-10-29 22:12:21 -07:00