2 changed files with 14 additions and 35 deletions
@ -1,59 +1,38 @@
|
||||
//! Meta-information of this crate.
|
||||
|
||||
#[macro_export] |
||||
macro_rules! doc_comment { |
||||
($x:expr, $($tt:tt)*) => { |
||||
#[doc = $x] |
||||
$($tt)* |
||||
}; |
||||
} |
||||
|
||||
macro_rules! meta_str { |
||||
($($(#[$outer:meta])* $name:ident = $e:expr;)*) => { |
||||
$($(#[$outer])* pub const fn $name() -> &'static str { $e })* |
||||
$($(#[$outer])* pub const $name: &'static str = $e;)* |
||||
|
||||
pub mod ffi { |
||||
$( |
||||
doc_comment! { |
||||
concat!( |
||||
"FFI variant of [`", |
||||
stringify!($name), |
||||
"`]\n\n[`", |
||||
stringify!($name), |
||||
"`]: ../fn.", |
||||
stringify!($name), |
||||
".html" |
||||
), |
||||
pub const fn $name() -> crate::ffi::Nts { c_str!($e) } |
||||
} |
||||
)* |
||||
$(pub const $name: crate::ffi::Nts = c_str!($e);)* |
||||
} |
||||
} |
||||
} |
||||
|
||||
meta_str! { |
||||
/// The authors of this crate, `:` separated.
|
||||
authors = env!("CARGO_PKG_AUTHORS"); |
||||
AUTHORS = env!("CARGO_PKG_AUTHORS"); |
||||
/// The description of this crate.
|
||||
description = env!("CARGO_PKG_DESCRIPTION"); |
||||
DESCRIPTION = env!("CARGO_PKG_DESCRIPTION"); |
||||
/// The home page of this crate.
|
||||
homepage = env!("CARGO_PKG_HOMEPAGE"); |
||||
HOMEPAGE = env!("CARGO_PKG_HOMEPAGE"); |
||||
/// The full license text of this crate.
|
||||
license_text = include_str!("../../LICENSE"); |
||||
LICENSE_TEXT = include_str!("../../LICENSE"); |
||||
/// The name of this crate.
|
||||
name = env!("CARGO_PKG_NAME"); |
||||
NAME = env!("CARGO_PKG_NAME"); |
||||
/// The repository of this crate.
|
||||
repository = env!("CARGO_PKG_REPOSITORY"); |
||||
REPOSITORY = env!("CARGO_PKG_REPOSITORY"); |
||||
/// The full version of this crate.
|
||||
version = env!("CARGO_PKG_VERSION"); |
||||
VERSION = env!("CARGO_PKG_VERSION"); |
||||
/// The major version of this crate.
|
||||
version_major = env!("CARGO_PKG_VERSION_MAJOR"); |
||||
VERSION_MAJOR = env!("CARGO_PKG_VERSION_MAJOR"); |
||||
/// The minor version of this crate.
|
||||
version_minor = env!("CARGO_PKG_VERSION_MINOR"); |
||||
VERSION_MINOR = env!("CARGO_PKG_VERSION_MINOR"); |
||||
/// The patch version of this crate.
|
||||
version_patch = env!("CARGO_PKG_VERSION_PATCH"); |
||||
VERSION_PATCH = env!("CARGO_PKG_VERSION_PATCH"); |
||||
/// The pre-release version of this crate.
|
||||
version_pre = env!("CARGO_PKG_VERSION_PRE"); |
||||
VERSION_PRE = env!("CARGO_PKG_VERSION_PRE"); |
||||
} |
||||
|
||||
// EOF
|
||||
|
Loading…
Reference in new issue