ctor 1.0.1

__attribute__((constructor)) for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Matches the `ctor` README introduction (`cargo run --example ctor-basic`).
#![cfg_attr(linktime_used_linker, feature(used_with_arg))]

use ctor::ctor;
use libc_print::*;

#[ctor(unsafe)]
fn foo() {
    libc_println!("Life before main!");
}

fn main() {
    libc_println!("main");
}