Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 655f5b3

Browse files
committed
Make compatible with windows build system
Don't use ##args style in macros
1 parent 6f47dc7 commit 655f5b3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/rumsort.c

+10-5
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,10 @@ copytup_rumitem(RumTuplesortstate * state, SortTuple *stup, void *tup)
194194
#define LT_TYPE LogicalTape *
195195
#define LT_ARG tape
196196
#define TAPE(state, LT_ARG) LT_ARG
197-
#define LogicalTapeReadExact_compat(state, LT_ARG, args...) LogicalTapeReadExact(LT_ARG, ##args)
198197
#else
199198
#define LT_TYPE int
200199
#define LT_ARG tapenum
201200
#define TAPE(state, LT_ARG) state->tapeset, LT_ARG
202-
#define LogicalTapeReadExact_compat(state, LT_ARG, args...) LogicalTapeReadExact(state->tapeset, LT_ARG, ##args)
203201
#endif
204202

205203
static Size
@@ -252,16 +250,23 @@ readtup_rum_internal(RumTuplesortstate * state, SortTuple *stup,
252250
Assert(tuplen == size);
253251

254252
USEMEM(state, GetMemoryChunkSpace(item));
255-
LogicalTapeReadExact_compat(state, LT_ARG, item, size);
256-
253+
#if PG_VERSION_NUM >= 150000
254+
LogicalTapeReadExact(LT_ARG, item, size);
255+
#else
256+
LogicalTapeReadExact(state->tapeset, LT_ARG, item, size);
257+
#endif
257258
stup->tuple = item;
258259
stup->isnull1 = is_item;
259260

260261
if (!is_item)
261262
stup->datum1 = Float8GetDatum(state->nKeys > 0 ? ((RumSortItem *) item)->data[0] : 0);
262263

263264
if (state->randomAccess) /* need trailing length word? */
264-
LogicalTapeReadExact_compat(state, LT_ARG, &tuplen, sizeof(tuplen));
265+
#if PG_VERSION_NUM >= 150000
266+
LogicalTapeReadExact(LT_ARG, &tuplen, sizeof(tuplen));
267+
#else
268+
LogicalTapeReadExact(state->tapeset, LT_ARG, &tuplen, sizeof(tuplen));
269+
#endif
265270
}
266271

267272
static void

0 commit comments

Comments
 (0)