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

src/rumsort.c

Lines changed: 11 additions & 7 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy