Commit Graph

58 Commits

Author SHA1 Message Date
Yuki Okushi 5b2bdd1125 Replace CI badge 2020-10-15 21:02:07 +09:00
David Stroud 09d233b42f 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 55dcb8eccc 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 e9a1268320 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 aacedf0bfb
Tweak building documentation 2020-07-08 16:48:03 +09:00
Yuki Okushi c4c452678b
Put index.html using unstable rustdoc features 2020-07-08 08:26:07 +09:00
Yuki Okushi f0a041c46d
Fix pipelines badge on README 2020-03-11 03:46:06 +09:00
bors d742eedf90 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 5dfc2c8285
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 284184d140
Readme updates 2019-10-17 20:03:51 -07:00
gnzlbg 07d1f7a495 Remove broken link 2019-10-17 15:38:54 +02:00
gnzlbg e7865a15a3 Update README Azure badge to rust-lang2 org 2019-08-12 10:15:35 +02:00
gnzlbg 1e121314f6 Remove Appveyor 2019-07-27 13:25:22 +02:00
gnzlbg 6ca5bfaea1 Setup Azure Pipelines 2019-07-27 13:25:22 +02:00
Jonathan Behrens cc33108bb9
Fix link in README.md 2019-06-28 15:21:44 -04:00
gnzlbg 4ac26afa83 Deprecate `use_std` cargo feature: use `std` instead .
Related to #657 .
2019-05-24 13:22:03 +02:00
gnzlbg dda85056bf Fix broken links in README 2019-02-21 10:18:06 +01:00
gnzlbg cd49efc997 Fix typo in README; do not generate .nojekyll file in gh-pages branch 2019-02-21 08:46:25 +01:00
gnzlbg 83298283c7 Generate a proper landing page for the master docs 2019-02-13 14:48:50 +01:00
Arnav Borborah 152fd7e6d2
Fix license badge 2019-02-08 20:22:24 -05:00
gnzlbg 5c796c5897 Align Rust-version support table of the README 2019-02-07 20:06:50 +01:00
gnzlbg ca12725dbf Document platform support in the README 2019-02-07 13:44:32 +01:00
Bryant Mairs cd1e16d1af Implement Hash for all types 2019-02-02 16:32:00 -08:00
Bryant Mairs 79ae1217c2 Implement Debug for all types 2019-02-02 13:06:58 -08:00
Bryant Mairs 868a85d05d Implement PartialEq,Eq for all types 2019-02-02 13:06:58 -08:00
Alex Crichton 09c4c2345b Test out new bors integration
See if it works with Cirrus CI!
2019-01-02 10:27:19 -08:00
Alan Somers e3bb3d7f8e [skip ci] Add a Cirrus-ci.com build badge
Reported-by: Alex Zepeda
2019-01-01 19:26:36 -07:00
gnzlbg 7afe55be24 Use crates.io keywords and categories
Closes #651 .
2018-11-22 19:06:40 +01:00
gnzlbg d1457314dd Factor out platforms for which libc is empty 2018-11-20 11:19:34 +01:00
Linus Färnstrand e167a73564 Describe the align feature in the readme 2018-07-30 16:57:55 +02:00
BC Ko 8a120921bf
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 254bf2edce fix README.md links 2018-04-21 21:56:52 +02:00
bgermann cf70168621 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 b9fdcf9467 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 2e11d9e14c 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 97a158b3a8 Add instructions of how to make a release
Anyone can do it!
2017-04-26 15:44:19 -07:00
Kevin Brothaler 3800c7380c Fixup target triple name 2017-01-17 21:38:37 -04:00
Corey Farwell 15dcbb5dad Fix appveyor badge. 2016-11-26 13:49:49 -05:00
Niels Sascha Reedijk a3ff95554e 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 cba130bc01
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 e335c50b13 Remove iOS doc links from README 2016-04-02 18:41:19 -05:00
Alex Crichton b7b90d4a4d Update links in README for transition to rust-lang 2016-02-11 18:37:10 -08:00
Alex Crichton 6d46b6fa5f 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 9522711192 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
Alex Crichton be5ad7d090 Fix travis links 2015-10-29 17:50:50 -07:00
Alex Crichton bbf73ded8d Add a link to the RFC from the README 2015-10-29 12:28:25 -07:00
Alex Crichton 1f7e2e821a Fix appveyor link 2015-10-29 12:02:05 -07:00