tdb: also use __has_attribute macro to check for attribute support