Commit Graph

12 Commits

Author SHA1 Message Date
Alan Somers
469032433d Replace most instances of mem::uninitialized with mem::MaybeUninit
Only two instances remain:

* For the deprecated sys::socket::CmsgSpace::new.  We should probably
  just remove that method.

* For sys::termios::Termios::default_uninit.  This will require some
  more thought.

Fixes #1096
2019-09-03 16:25:41 -06:00
Bryant Mairs
eabdced459 Match libc_bitflags! syntax to upstream bitflags! 2017-08-16 19:36:51 -07:00
Simon Sapin
e47d55c3be Update bitflags to 0.7 2017-02-16 16:18:44 +01:00
Philipp Matthias Schaefer
363fc28b48 Introduce CHANGELOG.md
- Added initial CHANGELOG.md with Changes from Version 0.6.0 and the
  upcoming changes for version 0.7.0.
- Added RELEASE_PROCEDURE.md detailing what changes should be made
  to CHANGELOG.md during a release.
- Added sections about CHANGELOG.md in CONVENTIONS.md and
  CONTRIBUTIONS.md.
2016-07-22 23:42:34 +02:00
Kamal Marhubi
81538653f2 doc: Minor whitespace fix in CONVENTIONS.md 2016-03-28 18:54:45 -04:00
Kamal Marhubi
b4c9f5bad1 Add libc_bitflags convenience macro
We define many bitflags types with values from the libc crate. Currently
these look like this:

    bitflags!{
        flags ProtFlags: libc::c_int {
            const PROT_NONE      = libc::PROT_NONE,
            const PROT_READ      = libc::PROT_READ,
            const PROT_WRITE     = libc::PROT_WRITE,
            const PROT_EXEC      = libc::PROT_EXEC,
            #[cfg(any(target_os = "linux", target_os = "android"))]
            const PROT_GROWSDOWN = libc::PROT_GROWSDOWN,
            #[cfg(any(target_os = "linux", target_os = "android"))]
            const PROT_GROWSUP   = libc::PROT_GROWSUP,
        }
    }

There's some repetition which is tedious. With the new macro, the above
can instead be written

    libc_bitflags!{
        flags ProtFlags: libc::c_int {
            PROT_NONE,
            PROT_READ,
            PROT_WRITE,
            PROT_EXEC,
            #[cfg(any(target_os = "linux", target_os = "android"))]
            PROT_GROWSDOWN,
            #[cfg(any(target_os = "linux", target_os = "android"))]
            PROT_GROWSUP,
        }
    }

Thanks to Daniel Keep for the Little Book of Rust Macros, and for
helping with this macro.

Refs https://github.com/nix-rust/nix/issues/264
2016-03-16 11:59:03 -04:00
Kamal Marhubi
6f0bcde619 conventions: Codify use of newtypes 2016-03-11 11:40:22 -05:00
Philipp Matthias Schaefer
3835777e93 Extend section on constants to include functions and structs. 2016-02-29 20:26:05 +01:00
Philipp Matthias Schaefer
d4575c591d Document naming convention for flag types. 2016-02-29 20:21:39 +01:00
Philipp Matthias Schaefer
4c5861c44e Add introduction/constants/enumeration/uninitialized to CONVENTIONS. 2016-02-28 08:46:07 +01:00
Philipp Matthias Schaefer
7502db05f5 Amend bitflags convention to cover all cases. 2016-02-01 16:24:19 -05:00
Philipp Matthias Schaefer
c3cecb8e42 Add file detailing conventions for nix. 2016-02-01 16:24:19 -05:00