Skip to content

Commit

Permalink
fix PHP 7
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl committed Sep 4, 2024
1 parent ad0d1d3 commit 5dc1c85
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion profiling/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ use clocks::*;
use core::ptr;
use ddcommon::{cstr, tag, tag::Tag};
use lazy_static::lazy_static;
use libc::{c_char, c_void};
use libc::c_char;
#[cfg(php_zts)]
use libc::c_void;
use log::{debug, error, info, trace, warn};
use once_cell::sync::{Lazy, OnceCell};
use profiling::{LocalRootSpanResourceMessage, Profiler, VmInterrupt};
Expand Down Expand Up @@ -130,6 +132,7 @@ extern "C" {

/// We do not need this, as we do not have any globals, but as we want PHP to call GINIT and
/// GSHUTDOWN, we need to have a valid pointer here.
#[cfg(php_zts)]
static mut GLOBALS_ID_PTR: i32 = 0;

/// The function `get_module` is what makes this a PHP module. Please do not
Expand Down Expand Up @@ -179,10 +182,13 @@ pub extern "C" fn get_module() -> &'static mut zend::ModuleEntry {
unsafe { &mut *ptr::addr_of_mut!(MODULE) }
}

#[cfg(php_zts)]
unsafe extern "C" fn ginit(_globals_ptr: *mut c_void) {
#[cfg(all(feature = "timeline", php_zts))]
timeline::timeline_ginit();
}

#[cfg(php_zts)]
unsafe extern "C" fn gshutdown(_globals_ptr: *mut c_void) {
#[cfg(all(feature = "timeline", php_zts))]
timeline::timeline_gshutdown();
Expand Down

0 comments on commit 5dc1c85

Please sign in to comment.