Oid record_type;
int32 record_typmod;
int ncolumns;
- ColumnIOData columns[1]; /* VARIABLE LENGTH ARRAY */
+ ColumnIOData columns[FLEXIBLE_ARRAY_MEMBER];
} RecordIOData;
/*
int32 record1_typmod;
Oid record2_type;
int32 record2_typmod;
- ColumnCompareData columns[1]; /* VARIABLE LENGTH ARRAY */
+ ColumnCompareData columns[FLEXIBLE_ARRAY_MEMBER];
} RecordCompareData;
{
fcinfo->flinfo->fn_extra =
MemoryContextAlloc(fcinfo->flinfo->fn_mcxt,
- sizeof(RecordIOData) - sizeof(ColumnIOData)
- + ncolumns * sizeof(ColumnIOData));
+ offsetof(RecordIOData, columns) +
+ ncolumns * sizeof(ColumnIOData));
my_extra = (RecordIOData *) fcinfo->flinfo->fn_extra;
my_extra->record_type = InvalidOid;
my_extra->record_typmod = 0;
my_extra->record_typmod != tupTypmod)
{
MemSet(my_extra, 0,
- sizeof(RecordIOData) - sizeof(ColumnIOData)
- + ncolumns * sizeof(ColumnIOData));
+ offsetof(RecordIOData, columns) +
+ ncolumns * sizeof(ColumnIOData));
my_extra->record_type = tupType;
my_extra->record_typmod = tupTypmod;
my_extra->ncolumns = ncolumns;
{
fcinfo->flinfo->fn_extra =
MemoryContextAlloc(fcinfo->flinfo->fn_mcxt,
- sizeof(RecordIOData) - sizeof(ColumnIOData)
- + ncolumns * sizeof(ColumnIOData));
+ offsetof(RecordIOData, columns) +
+ ncolumns * sizeof(ColumnIOData));
my_extra = (RecordIOData *) fcinfo->flinfo->fn_extra;
my_extra->record_type = InvalidOid;
my_extra->record_typmod = 0;
my_extra->record_typmod != tupTypmod)
{
MemSet(my_extra, 0,
- sizeof(RecordIOData) - sizeof(ColumnIOData)
- + ncolumns * sizeof(ColumnIOData));
+ offsetof(RecordIOData, columns) +
+ ncolumns * sizeof(ColumnIOData));
my_extra->record_type = tupType;
my_extra->record_typmod = tupTypmod;
my_extra->ncolumns = ncolumns;
{
fcinfo->flinfo->fn_extra =
MemoryContextAlloc(fcinfo->flinfo->fn_mcxt,
- sizeof(RecordIOData) - sizeof(ColumnIOData)
- + ncolumns * sizeof(ColumnIOData));
+ offsetof(RecordIOData, columns) +
+ ncolumns * sizeof(ColumnIOData));
my_extra = (RecordIOData *) fcinfo->flinfo->fn_extra;
my_extra->record_type = InvalidOid;
my_extra->record_typmod = 0;
my_extra->record_typmod != tupTypmod)
{
MemSet(my_extra, 0,
- sizeof(RecordIOData) - sizeof(ColumnIOData)
- + ncolumns * sizeof(ColumnIOData));
+ offsetof(RecordIOData, columns) +
+ ncolumns * sizeof(ColumnIOData));
my_extra->record_type = tupType;
my_extra->record_typmod = tupTypmod;
my_extra->ncolumns = ncolumns;
{
fcinfo->flinfo->fn_extra =
MemoryContextAlloc(fcinfo->flinfo->fn_mcxt,
- sizeof(RecordIOData) - sizeof(ColumnIOData)
- + ncolumns * sizeof(ColumnIOData));
+ offsetof(RecordIOData, columns) +
+ ncolumns * sizeof(ColumnIOData));
my_extra = (RecordIOData *) fcinfo->flinfo->fn_extra;
my_extra->record_type = InvalidOid;
my_extra->record_typmod = 0;
my_extra->record_typmod != tupTypmod)
{
MemSet(my_extra, 0,
- sizeof(RecordIOData) - sizeof(ColumnIOData)
- + ncolumns * sizeof(ColumnIOData));
+ offsetof(RecordIOData, columns) +
+ ncolumns * sizeof(ColumnIOData));
my_extra->record_type = tupType;
my_extra->record_typmod = tupTypmod;
my_extra->ncolumns = ncolumns;
{
fcinfo->flinfo->fn_extra =
MemoryContextAlloc(fcinfo->flinfo->fn_mcxt,
- sizeof(RecordCompareData) - sizeof(ColumnCompareData)
- + ncols * sizeof(ColumnCompareData));
+ offsetof(RecordCompareData, columns) +
+ ncols * sizeof(ColumnCompareData));
my_extra = (RecordCompareData *) fcinfo->flinfo->fn_extra;
my_extra->ncolumns = ncols;
my_extra->record1_type = InvalidOid;
{
fcinfo->flinfo->fn_extra =
MemoryContextAlloc(fcinfo->flinfo->fn_mcxt,
- sizeof(RecordCompareData) - sizeof(ColumnCompareData)
- + ncols * sizeof(ColumnCompareData));
+ offsetof(RecordCompareData, columns) +
+ ncols * sizeof(ColumnCompareData));
my_extra = (RecordCompareData *) fcinfo->flinfo->fn_extra;
my_extra->ncolumns = ncols;
my_extra->record1_type = InvalidOid;
{
fcinfo->flinfo->fn_extra =
MemoryContextAlloc(fcinfo->flinfo->fn_mcxt,
- sizeof(RecordCompareData) - sizeof(ColumnCompareData)
- + ncols * sizeof(ColumnCompareData));
+ offsetof(RecordCompareData, columns) +
+ ncols * sizeof(ColumnCompareData));
my_extra = (RecordCompareData *) fcinfo->flinfo->fn_extra;
my_extra->ncolumns = ncols;
my_extra->record1_type = InvalidOid;
{
fcinfo->flinfo->fn_extra =
MemoryContextAlloc(fcinfo->flinfo->fn_mcxt,
- sizeof(RecordCompareData) - sizeof(ColumnCompareData)
- + ncols * sizeof(ColumnCompareData));
+ offsetof(RecordCompareData, columns) +
+ ncols * sizeof(ColumnCompareData));
my_extra = (RecordCompareData *) fcinfo->flinfo->fn_extra;
my_extra->ncolumns = ncols;
my_extra->record1_type = InvalidOid;