simplify CopyVal() macro

This commit is contained in:
Vern Paxson 2024-07-24 14:13:40 -07:00
parent c96dd5d5b3
commit a32e1c593e

View file

@ -42,7 +42,7 @@ macro WARN(msg) ZAM_run_time_warning(Z_LOC, msg)
macro BuildVal(v, t) ZVal(v, t) macro BuildVal(v, t) ZVal(v, t)
# Returns a memory-managed-if-necessary copy of an existing value. # Returns a memory-managed-if-necessary copy of an existing value.
macro CopyVal(v) (ZVal::IsManagedType(Z_TYPE) ? BuildVal((v).ToVal(Z_TYPE), Z_TYPE) : (v)) macro CopyVal(v) (Z_IS_MANAGED ? BuildVal((v).ToVal(Z_TYPE), Z_TYPE) : (v))
# Managed assignments to the given target. # Managed assignments to the given target.
macro AssignTarget(target, v) { macro AssignTarget(target, v) {