Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename the dox configuration option to cross_platform_docs #951

Merged
merged 2 commits into from
Mar 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 56 additions & 58 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "libc"
version = "0.2.39"
version = "0.2.40"
authors = ["The Rust Project Developers"]
license = "MIT/Apache-2.0"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion ci/dox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cp ci/landing-page-head.html target/doc/index.html
for target in $TARGETS; do
echo documenting $target

rustdoc -o target/doc/$target --target $target src/lib.rs --cfg dox \
rustdoc -o target/doc/$target --target $target src/lib.rs --cfg cross_platform_docs \
--crate-name libc

echo "<li><a href="/libc/$target/libc/index.html">$target</a></li>" \
Expand Down
4 changes: 2 additions & 2 deletions src/dox.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
pub use self::imp::*;

#[cfg(not(dox))]
#[cfg(not(cross_platform_docs))]
mod imp {
pub use core::option::Option;
pub use core::clone::Clone;
pub use core::marker::Copy;
pub use core::mem;
}

#[cfg(dox)]
#[cfg(cross_platform_docs)]
mod imp {
pub enum Option<T> {
Some(T),
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#![allow(bad_style, overflowing_literals, improper_ctypes)]
#![crate_type = "rlib"]
#![crate_name = "libc"]
#![cfg_attr(dox, feature(no_core, lang_items))]
#![cfg_attr(dox, no_core)]
#![cfg_attr(cross_platform_docs, feature(no_core, lang_items))]
#![cfg_attr(cross_platform_docs, no_core)]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico")]

Expand Down Expand Up @@ -97,7 +97,7 @@

#![cfg_attr(not(feature = "use_std"), no_std)]

#[cfg(all(not(dox), feature = "use_std"))]
#[cfg(all(not(cross_platform_docs), feature = "use_std"))]
extern crate std as core;

#[macro_use] mod macros;
Expand Down
4 changes: 2 additions & 2 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ macro_rules! f {
$($body:stmt);*
})*) => ($(
#[inline]
#[cfg(not(dox))]
#[cfg(not(cross_platform_docs))]
pub unsafe extern fn $i($($arg: $argty),*) -> $ret {
$($body);*
}

#[cfg(dox)]
#[cfg(cross_platform_docs)]
#[allow(dead_code)]
pub unsafe extern fn $i($($arg: $argty),*) -> $ret {
loop {}
Expand Down
2 changes: 1 addition & 1 deletion src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ pub const INADDR_BROADCAST: in_addr_t = 4294967295;
pub const INADDR_NONE: in_addr_t = 4294967295;

cfg_if! {
if #[cfg(dox)] {
if #[cfg(cross_platform_docs)] {
// on dox builds don't pull in anything
} else if #[cfg(target_os = "l4re")] {
// required libraries for L4Re are linked externally, ATM
Expand Down