Skip to main content

ctor

Macro ctor 

Source
macro_rules! ctor {
    ( $($input:tt)* ) => { ... };
}
Expand description

Declarative form of the #[ctor] macro.

The declarative forms wrap and parse a proc_macro-like syntax like so, and are identical in expansion to the undecorated procedural macros. The declarative forms support the same attribute parameters as the procedural macros.

ctor::declarative::ctor! {
  #[ctor]
  fn foo() {
    libc_println!("Hello, world!");
  }
}

// ... the above is identical to:

#[ctor]
fn foo() {
  libc_println!("Hello, world!");
}