Skip to content

Commit

Permalink
libc: re-export libc properly
Browse files Browse the repository at this point in the history
With rust 1.7, the following warning was being emitted by the compiler:

    warning: `pub extern crate` does not work as expected and should
    not be used. Likely to become an error. Prefer `extern crate` and
    `pub use`.

Based on rust-lang/rust#26775 it appears that
this change is the current best approach for properly exporting the
libc dependency so it may be used outside of nix.

Signed-off-by: Paul Osborne <osbpau@gmail.com>
  • Loading branch information
posborne committed Mar 4, 2016
1 parent 5bac9df commit 99d6a00
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
#[macro_use]
extern crate bitflags;

pub extern crate libc;

#[cfg(test)]
extern crate nix_test as nixtest;

mod exports {
extern crate libc;
}

// Re-exports
pub use exports::libc;
pub use libc::{c_int, c_void};
pub use errno::Errno;

Expand Down

0 comments on commit 99d6a00

Please sign in to comment.