Starting from PostgreSQL 18 onwards TupleDesc no longer contains attr. it now uses CompactAttr compact_attr.
In PostgreSQL 16, we still support both attr and compact_attrs.
We need to define a macro that can resolve to both tts_tupleDescriptor->attr[i] and to TupleDescAttr(tts_tupleDescriptor, i)