diff --git a/src/functions.rs b/src/functions.rs index a87df1d..448842a 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -1,4 +1,4 @@ -use crate::bindings::{ZEND_BUILD_TS, ZEND_MODULE_API_NO}; +use crate::bindings::{ZEND_BUILD_TS, ZEND_MODULE_API_NO, ZEND_BUILD_DEBUG, ZEND_BUILD_SYSTEM, ZEND_BUILD_EXTRA}; use std::ffi::{CStr, CString}; /// Takes a Rust string object, converts it into a C string @@ -38,9 +38,15 @@ pub(crate) fn build_id() -> String { // UNSAFE: reading a constant which has been translated from C, only reading and not // modifying. let zend_build_ts = unsafe { CStr::from_ptr(ZEND_BUILD_TS.as_ptr() as *const i8) }; + let zend_build_debug = unsafe { CStr::from_ptr(ZEND_BUILD_DEBUG.as_ptr() as *const i8) }; + let zend_build_system = unsafe { CStr::from_ptr(ZEND_BUILD_SYSTEM.as_ptr() as *const i8) }; + let zend_build_extra = unsafe { CStr::from_ptr(ZEND_BUILD_EXTRA.as_ptr() as *const i8) }; format!( - "API{}{}", + "API{}{}{}{}{}", ZEND_MODULE_API_NO, - zend_build_ts.to_str().unwrap() + zend_build_ts.to_str().unwrap(), + zend_build_debug.to_str().unwrap(), + zend_build_system.to_str().unwrap(), + zend_build_extra.to_str().unwrap() ) } diff --git a/wrapper.h b/wrapper.h index ba68162..3a52bc5 100644 --- a/wrapper.h +++ b/wrapper.h @@ -1,3 +1,9 @@ #include "php.h" #include "ext/standard/info.h" -#include "zend_extensions.h" \ No newline at end of file +#include "zend_exceptions.h" + +// Need to define these as empty strings to ensure that +// bindgen generates them. +#define ZEND_BUILD_DEBUG "" +#define ZEND_BUILD_SYSTEM "" +#define ZEND_BUILD_EXTRA ""