From a1cd01b30542589ed136154e38d5ac03018f9eed Mon Sep 17 00:00:00 2001 From: Xenira <1288524+Xenira@users.noreply.github.com> Date: Sun, 9 Feb 2025 07:39:27 +0100 Subject: [PATCH] chore(cfg): change php81 cfg to 8.1+ --- build.rs | 3 ++- src/builders/class.rs | 2 +- src/flags.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build.rs b/build.rs index 89e40ff7f0..28da2a2466 100644 --- a/build.rs +++ b/build.rs @@ -241,7 +241,7 @@ fn check_php_version(info: &PHPInfo) -> Result<()> { println!("cargo:warning=PHP version 8.0 is EOL and will no longer be supported in a future release. Please upgrade to a supported version of PHP. See https://www.php.net/supported-versions.php for information on version support timelines."); } - if (PHP_81_API_VER..PHP_82_API_VER).contains(&version) { + if version >= PHP_81_API_VER { println!("cargo:rustc-cfg=php81"); } @@ -285,6 +285,7 @@ fn main() -> Result<()> { if env::var("DOCS_RS").is_ok() { println!("cargo:warning=docs.rs detected - using stub bindings"); println!("cargo:rustc-cfg=php_debug"); + println!("cargo:rustc-cfg=php81"); println!("cargo:rustc-cfg=php82"); std::fs::copy("docsrs_bindings.rs", out_path) .expect("failed to copy docs.rs stub bindings to out directory"); diff --git a/src/builders/class.rs b/src/builders/class.rs index 9224536906..bc1f29f14a 100644 --- a/src/builders/class.rs +++ b/src/builders/class.rs @@ -247,7 +247,7 @@ impl ClassBuilder { // disable serialization if the class has an associated object if self.object_override.is_some() { cfg_if::cfg_if! { - if #[cfg(any(php81, php82))] { + if #[cfg(php81)] { class.ce_flags |= ClassFlags::NotSerializable.bits(); } else { class.serialize = Some(crate::ffi::zend_class_serialize_deny); diff --git a/src/flags.rs b/src/flags.rs index da3a6844c8..259a73e35a 100644 --- a/src/flags.rs +++ b/src/flags.rs @@ -91,7 +91,7 @@ bitflags! { const UnresolvedVariance = ZEND_ACC_UNRESOLVED_VARIANCE; const NearlyLinked = ZEND_ACC_NEARLY_LINKED; - #[cfg(any(php81,php82))] + #[cfg(php81)] const NotSerializable = crate::ffi::ZEND_ACC_NOT_SERIALIZABLE; } }