From 94f38e9515d94f0e3460d3e938bae1d02814bd22 Mon Sep 17 00:00:00 2001 From: jmjoy Date: Wed, 4 Mar 2026 17:35:04 +0800 Subject: [PATCH] feat: Add documentation attributes for ZTS macros --- phper/src/macros.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/phper/src/macros.rs b/phper/src/macros.rs index f16ca32..6655513 100644 --- a/phper/src/macros.rs +++ b/phper/src/macros.rs @@ -81,6 +81,7 @@ macro_rules! deprecated { /// Equivalent to the php `CG`. #[macro_export] #[cfg(phper_zts)] +#[cfg_attr(docsrs, doc(cfg(true)))] macro_rules! cg { ($x:ident) => { (*($crate::sys::ts_resource_ex($crate::sys::compiler_globals_id, std::ptr::null_mut()) @@ -92,6 +93,7 @@ macro_rules! cg { /// Equivalent to the php `CG`. #[macro_export] #[cfg(not(phper_zts))] +#[cfg_attr(docsrs, doc(cfg(true)))] macro_rules! cg { ($x:ident) => { $crate::sys::compiler_globals.$x @@ -101,6 +103,7 @@ macro_rules! cg { /// Equivalent to the php `EG`. #[macro_export] #[cfg(phper_zts)] +#[cfg_attr(docsrs, doc(cfg(true)))] macro_rules! eg { ($x:ident) => { (*($crate::sys::ts_resource_ex($crate::sys::executor_globals_id, std::ptr::null_mut()) @@ -112,6 +115,7 @@ macro_rules! eg { /// Equivalent to the php `EG`. #[macro_export] #[cfg(not(phper_zts))] +#[cfg_attr(docsrs, doc(cfg(true)))] macro_rules! eg { ($x:ident) => { $crate::sys::executor_globals.$x @@ -121,6 +125,7 @@ macro_rules! eg { /// Equivalent to the php `PG`. #[macro_export] #[cfg(phper_zts)] +#[cfg_attr(docsrs, doc(cfg(true)))] macro_rules! pg { ($x:ident) => { (*($crate::sys::ts_resource_ex($crate::sys::core_globals_id, std::ptr::null_mut()) @@ -132,6 +137,7 @@ macro_rules! pg { /// Equivalent to the php `PG`. #[macro_export] #[cfg(not(phper_zts))] +#[cfg_attr(docsrs, doc(cfg(true)))] macro_rules! pg { ($x:ident) => { $crate::sys::core_globals.$x @@ -141,6 +147,7 @@ macro_rules! pg { /// Equivalent to the php `SG`. #[macro_export] #[cfg(phper_zts)] +#[cfg_attr(docsrs, doc(cfg(true)))] macro_rules! sg { ($x:ident) => { (*($crate::sys::ts_resource_ex($crate::sys::sapi_globals_id, std::ptr::null_mut()) @@ -152,6 +159,7 @@ macro_rules! sg { /// Equivalent to the php `SG`. #[macro_export] #[cfg(not(phper_zts))] +#[cfg_attr(docsrs, doc(cfg(true)))] macro_rules! sg { ($x:ident) => { $crate::sys::sapi_globals.$x