Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ regex = "1"
cc = "1.0.67"

[features]
zts = []
debug = []

alloc = []
closure = []

Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ fn main() {
let configure = Configure::get();

if configure.has_zts() {
println!("cargo:rustc-cfg=feature=\"zts\"");
println!("cargo:rustc-cfg=php_zts");
}

if configure.debug() {
println!("cargo:rustc-cfg=feature=\"debug\"");
println!("cargo:rustc-cfg=php_debug");
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/php/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ pub fn emalloc(layout: Layout) -> *mut u8 {
let size = layout.size();

(unsafe {
#[cfg(feature = "debug")]
#[cfg(php_debug)]
{
_emalloc(size as _, std::ptr::null_mut(), 0, std::ptr::null_mut(), 0)
}
#[cfg(not(feature = "debug"))]
#[cfg(not(php_debug))]
{
_emalloc(size as _)
}
Expand All @@ -39,7 +39,7 @@ pub fn emalloc(layout: Layout) -> *mut u8 {
/// Caller must guarantee that the given pointer is valid (aligned and non-null) and
/// was originally allocated through the Zend memory manager.
pub unsafe fn efree(ptr: *mut u8) {
#[cfg(feature = "debug")]
#[cfg(php_debug)]
{
_efree(
ptr as *mut c_void,
Expand All @@ -49,7 +49,7 @@ pub unsafe fn efree(ptr: *mut u8) {
0,
)
}
#[cfg(not(feature = "debug"))]
#[cfg(not(php_debug))]
{
_efree(ptr as *mut c_void)
}
Expand Down
4 changes: 2 additions & 2 deletions src/php/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ impl ModuleBuilder {
info_func: None,
version: ptr::null(),
globals_size: 0,
#[cfg(not(feature = "zts"))]
#[cfg(not(php_zts))]
globals_ptr: ptr::null::<c_void>() as *mut c_void,
#[cfg(feature = "zts")]
#[cfg(php_zts)]
globals_id_ptr: ptr::null::<c_void>() as *mut crate::bindings::ts_rsrc_id,
globals_ctor: None,
globals_dtor: None,
Expand Down