Skip to content

Commit a79b46b

Browse files
committed
Allow trace_sort to be declared local to provide compatibility with
Windows builds of non-PGPRO versions and on versions < 13
1 parent aebcf8a commit a79b46b

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Diff for: src/rumsort.c

+11-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
#include "commands/tablespace.h"
2323
#include "executor/executor.h"
24-
#include "utils/guc.h"
2524
#include "utils/logtape.h"
2625
#include "utils/pg_rusage.h"
2726

@@ -52,13 +51,18 @@
5251
* Below are copied definitions from src/backend/utils/sort/tuplesort.c.
5352
*/
5453

55-
/* GUC variables shouldn't be declared explicitely.
56-
Rather corresponigng include file should be include because it
57-
contains neccessary Windows export/import magic. And part of this
58-
magic should be done during postgres.exe compilation
59-
*/
54+
/* For PGPRO since v.13 trace_sort is imported from backend by including its
55+
* declaration in guc.h (guc.h contains added Windows export/import magic to be done
56+
* during postgres.exe compilation).
57+
* For older or non-PGPRO versions on Windows platform trace_sort is not exported by
58+
* backend so it is declared local for this case.
59+
*/
6060
#ifdef TRACE_SORT
61-
#include <utils/guc.h>
61+
#if PG_VERSION_NUM >= 130000 && defined (PGPRO_VERSION)
62+
#include "utils/guc.h"
63+
#else
64+
bool trace_sort = false;
65+
#endif
6266
#endif
6367

6468
typedef struct

0 commit comments

Comments
 (0)