@@ -2186,8 +2186,8 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
21862186XLogRegisterBufData (0 , (char * )& xlhdr ,SizeOfHeapHeader );
21872187/* PG73FORMAT: write bitmap [+ padding] [+ oid] + data */
21882188XLogRegisterBufData (0 ,
2189- (char * )heaptup -> t_data + offsetof( HeapTupleHeaderData , t_bits ) ,
2190- heaptup -> t_len - offsetof( HeapTupleHeaderData , t_bits ) );
2189+ (char * )heaptup -> t_data + SizeofHeapTupleHeader ,
2190+ heaptup -> t_len - SizeofHeapTupleHeader );
21912191
21922192recptr = XLogInsert (RM_HEAP_ID ,info );
21932193
@@ -2460,9 +2460,9 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
24602460tuphdr -> t_hoff = heaptup -> t_data -> t_hoff ;
24612461
24622462/* write bitmap [+ padding] [+ oid] + data */
2463- datalen = heaptup -> t_len - offsetof( HeapTupleHeaderData , t_bits ) ;
2463+ datalen = heaptup -> t_len - SizeofHeapTupleHeader ;
24642464memcpy (scratchptr ,
2465- (char * )heaptup -> t_data + offsetof( HeapTupleHeaderData , t_bits ) ,
2465+ (char * )heaptup -> t_data + SizeofHeapTupleHeader ,
24662466datalen );
24672467tuphdr -> datalen = datalen ;
24682468scratchptr += datalen ;
@@ -2904,9 +2904,9 @@ heap_delete(Relation relation, ItemPointer tid,
29042904
29052905XLogRegisterData ((char * )& xlhdr ,SizeOfHeapHeader );
29062906XLogRegisterData ((char * )old_key_tuple -> t_data
2907- + offsetof( HeapTupleHeaderData , t_bits ) ,
2907+ + SizeofHeapTupleHeader ,
29082908old_key_tuple -> t_len
2909- - offsetof( HeapTupleHeaderData , t_bits ) );
2909+ - SizeofHeapTupleHeader );
29102910}
29112911
29122912recptr = XLogInsert (RM_HEAP_ID ,XLOG_HEAP_DELETE );
@@ -6732,7 +6732,7 @@ log_heap_update(Relation reln, Buffer oldbuf,
67326732xlhdr .t_infomask2 = newtup -> t_data -> t_infomask2 ;
67336733xlhdr .t_infomask = newtup -> t_data -> t_infomask ;
67346734xlhdr .t_hoff = newtup -> t_data -> t_hoff ;
6735- Assert (offsetof( HeapTupleHeaderData , t_bits ) + prefixlen + suffixlen <=newtup -> t_len );
6735+ Assert (SizeofHeapTupleHeader + prefixlen + suffixlen <=newtup -> t_len );
67366736
67376737/*
67386738 * PG73FORMAT: write bitmap [+ padding] [+ oid] + data
@@ -6743,8 +6743,8 @@ log_heap_update(Relation reln, Buffer oldbuf,
67436743if (prefixlen == 0 )
67446744{
67456745XLogRegisterBufData (0 ,
6746- ((char * )newtup -> t_data )+ offsetof( HeapTupleHeaderData , t_bits ) ,
6747- newtup -> t_len - offsetof( HeapTupleHeaderData , t_bits ) - suffixlen );
6746+ ((char * )newtup -> t_data )+ SizeofHeapTupleHeader ,
6747+ newtup -> t_len - SizeofHeapTupleHeader - suffixlen );
67486748}
67496749else
67506750{
@@ -6753,11 +6753,11 @@ log_heap_update(Relation reln, Buffer oldbuf,
67536753 * two separate rdata entries.
67546754 */
67556755/* bitmap [+ padding] [+ oid] */
6756- if (newtup -> t_data -> t_hoff - offsetof( HeapTupleHeaderData , t_bits ) > 0 )
6756+ if (newtup -> t_data -> t_hoff - SizeofHeapTupleHeader > 0 )
67576757{
67586758XLogRegisterBufData (0 ,
6759- ((char * )newtup -> t_data )+ offsetof( HeapTupleHeaderData , t_bits ) ,
6760- newtup -> t_data -> t_hoff - offsetof( HeapTupleHeaderData , t_bits ) );
6759+ ((char * )newtup -> t_data )+ SizeofHeapTupleHeader ,
6760+ newtup -> t_data -> t_hoff - SizeofHeapTupleHeader );
67616761}
67626762
67636763/* data after common prefix */
@@ -6777,8 +6777,8 @@ log_heap_update(Relation reln, Buffer oldbuf,
67776777XLogRegisterData ((char * )& xlhdr_idx ,SizeOfHeapHeader );
67786778
67796779/* PG73FORMAT: write bitmap [+ padding] [+ oid] + data */
6780- XLogRegisterData ((char * )old_key_tuple -> t_data + offsetof( HeapTupleHeaderData , t_bits ) ,
6781- old_key_tuple -> t_len - offsetof( HeapTupleHeaderData , t_bits ) );
6780+ XLogRegisterData ((char * )old_key_tuple -> t_data + SizeofHeapTupleHeader ,
6781+ old_key_tuple -> t_len - SizeofHeapTupleHeader );
67826782}
67836783
67846784recptr = XLogInsert (RM_HEAP_ID ,info );
@@ -7351,7 +7351,7 @@ heap_xlog_insert(XLogReaderState *record)
73517351xl_heap_insert * xlrec = (xl_heap_insert * )XLogRecGetData (record );
73527352Buffer buffer ;
73537353Page page ;
7354- struct
7354+ union
73557355{
73567356HeapTupleHeaderData hdr ;
73577357char data [MaxHeapTupleSize ];
@@ -7415,12 +7415,12 @@ heap_xlog_insert(XLogReaderState *record)
74157415data += SizeOfHeapHeader ;
74167416
74177417htup = & tbuf .hdr ;
7418- MemSet ((char * )htup ,0 ,sizeof ( HeapTupleHeaderData ) );
7418+ MemSet ((char * )htup ,0 ,SizeofHeapTupleHeader );
74197419/* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
7420- memcpy ((char * )htup + offsetof( HeapTupleHeaderData , t_bits ) ,
7420+ memcpy ((char * )htup + SizeofHeapTupleHeader ,
74217421data ,
74227422newlen );
7423- newlen += offsetof( HeapTupleHeaderData , t_bits ) ;
7423+ newlen += SizeofHeapTupleHeader ;
74247424htup -> t_infomask2 = xlhdr .t_infomask2 ;
74257425htup -> t_infomask = xlhdr .t_infomask ;
74267426htup -> t_hoff = xlhdr .t_hoff ;
@@ -7469,7 +7469,7 @@ heap_xlog_multi_insert(XLogReaderState *record)
74697469BlockNumber blkno ;
74707470Buffer buffer ;
74717471Page page ;
7472- struct
7472+ union
74737473{
74747474HeapTupleHeaderData hdr ;
74757475char data [MaxHeapTupleSize ];
@@ -7548,14 +7548,14 @@ heap_xlog_multi_insert(XLogReaderState *record)
75487548newlen = xlhdr -> datalen ;
75497549Assert (newlen <=MaxHeapTupleSize );
75507550htup = & tbuf .hdr ;
7551- MemSet ((char * )htup ,0 ,sizeof ( HeapTupleHeaderData ) );
7551+ MemSet ((char * )htup ,0 ,SizeofHeapTupleHeader );
75527552/* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
7553- memcpy ((char * )htup + offsetof( HeapTupleHeaderData , t_bits ) ,
7553+ memcpy ((char * )htup + SizeofHeapTupleHeader ,
75547554 (char * )tupdata ,
75557555newlen );
75567556tupdata += newlen ;
75577557
7558- newlen += offsetof( HeapTupleHeaderData , t_bits ) ;
7558+ newlen += SizeofHeapTupleHeader ;
75597559htup -> t_infomask2 = xlhdr -> t_infomask2 ;
75607560htup -> t_infomask = xlhdr -> t_infomask ;
75617561htup -> t_hoff = xlhdr -> t_hoff ;
@@ -7618,7 +7618,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
76187618uint16 prefixlen = 0 ,
76197619suffixlen = 0 ;
76207620char * newp ;
7621- struct
7621+ union
76227622{
76237623HeapTupleHeaderData hdr ;
76247624char data [MaxHeapTupleSize ];
@@ -7780,19 +7780,19 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
77807780Assert (tuplen <=MaxHeapTupleSize );
77817781
77827782htup = & tbuf .hdr ;
7783- MemSet ((char * )htup ,0 ,sizeof ( HeapTupleHeaderData ) );
7783+ MemSet ((char * )htup ,0 ,SizeofHeapTupleHeader );
77847784
77857785/*
77867786 * Reconstruct the new tuple using the prefix and/or suffix from the
77877787 * old tuple, and the data stored in the WAL record.
77887788 */
7789- newp = (char * )htup + offsetof( HeapTupleHeaderData , t_bits ) ;
7789+ newp = (char * )htup + SizeofHeapTupleHeader ;
77907790if (prefixlen > 0 )
77917791{
77927792int len ;
77937793
77947794/* copy bitmap [+ padding] [+ oid] from WAL record */
7795- len = xlhdr .t_hoff - offsetof( HeapTupleHeaderData , t_bits ) ;
7795+ len = xlhdr .t_hoff - SizeofHeapTupleHeader ;
77967796memcpy (newp ,recdata ,len );
77977797recdata += len ;
77987798newp += len ;
@@ -7802,7 +7802,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
78027802newp += prefixlen ;
78037803
78047804/* copy new tuple data from WAL record */
7805- len = tuplen - (xlhdr .t_hoff - offsetof( HeapTupleHeaderData , t_bits ) );
7805+ len = tuplen - (xlhdr .t_hoff - SizeofHeapTupleHeader );
78067806memcpy (newp ,recdata ,len );
78077807recdata += len ;
78087808newp += len ;
@@ -7823,7 +7823,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
78237823if (suffixlen > 0 )
78247824memcpy (newp , (char * )oldtup .t_data + oldtup .t_len - suffixlen ,suffixlen );
78257825
7826- newlen = offsetof( HeapTupleHeaderData , t_bits ) + tuplen + prefixlen + suffixlen ;
7826+ newlen = SizeofHeapTupleHeader + tuplen + prefixlen + suffixlen ;
78277827htup -> t_infomask2 = xlhdr .t_infomask2 ;
78287828htup -> t_infomask = xlhdr .t_infomask ;
78297829htup -> t_hoff = xlhdr .t_hoff ;