Added separated file to store macros

This commit is contained in:
Jin Hu 2017-08-12 21:19:58 +08:00
commit 872ca624fb
4 changed files with 10 additions and 11 deletions

View file

@ -13,12 +13,6 @@ extern {
} }
macro_rules! c_str {
($s:expr) => { {
concat!($s, "\0").as_ptr() as *const c_char
} }
}
#[no_mangle] #[no_mangle]
pub extern fn php_module_startup(type_: c_int, module_number: c_int) -> c_int { pub extern fn php_module_startup(type_: c_int, module_number: c_int) -> c_int {
0 0

View file

@ -5,5 +5,8 @@
extern crate libc; extern crate libc;
#[macro_use]
pub mod macros;
pub mod zend; pub mod zend;
pub mod info; pub mod info;

7
src/macros.rs Normal file
View file

@ -0,0 +1,7 @@
#[macro_export]
macro_rules! c_str {
($s:expr) => { {
concat!($s, "\0").as_ptr() as *const c_char
} }
}

View file

@ -10,11 +10,6 @@ type GlobalsDtorFunc = extern fn (global: *const c_void) -> c_void;
type PostDeactivateFunc = extern fn () -> c_int; type PostDeactivateFunc = extern fn () -> c_int;
macro_rules! c_str {
($s:expr) => { {
concat!($s, "\0").as_ptr() as *const c_char
} }
}
pub struct ModuleDep {} pub struct ModuleDep {}
pub struct Function {} pub struct Function {}