From f31d708c2be7f0b6b1962a9d98107778075292c3 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Tue, 23 Jan 2024 12:40:13 +0200 Subject: [PATCH] Add direct include to pairingheap.h in headers ivfflat.h and hnsw.h have references to pairingheap_node, so they need to include lib/pairingheap.h. It happened to work, because lib/pairingheap.h was being included indirectly through nodes/execnodes.h, but let's be explicit. Remove the include from hnswbuild.c, because there are no calls to pairingheap functions in that file. Instead, add the includes to hnswutils.c and ivfscan.c, which do have such calls. They are not strictly necessary again because of the indirect include from hnsw.h and ivfflat.h, but let's be explicit while we're messing with this. --- src/hnsw.h | 1 + src/hnswbuild.c | 1 - src/hnswutils.c | 1 + src/ivfflat.h | 1 + src/ivfscan.c | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hnsw.h b/src/hnsw.h index 77147d1..7ab09d2 100644 --- a/src/hnsw.h +++ b/src/hnsw.h @@ -6,6 +6,7 @@ #include "access/generic_xlog.h" #include "access/parallel.h" #include "access/reloptions.h" +#include "lib/pairingheap.h" #include "nodes/execnodes.h" #include "port.h" /* for random() */ #include "utils/relptr.h" diff --git a/src/hnswbuild.c b/src/hnswbuild.c index d367a93..3fbb78d 100644 --- a/src/hnswbuild.c +++ b/src/hnswbuild.c @@ -46,7 +46,6 @@ #include "commands/progress.h" #include "hnsw.h" #include "miscadmin.h" -#include "lib/pairingheap.h" #include "optimizer/optimizer.h" #include "storage/bufmgr.h" #include "tcop/tcopprot.h" diff --git a/src/hnswutils.c b/src/hnswutils.c index 98d4710..e219530 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -3,6 +3,7 @@ #include #include "hnsw.h" +#include "lib/pairingheap.h" #include "storage/bufmgr.h" #include "utils/datum.h" #include "vector.h" diff --git a/src/ivfflat.h b/src/ivfflat.h index b35d8a5..366fc44 100644 --- a/src/ivfflat.h +++ b/src/ivfflat.h @@ -6,6 +6,7 @@ #include "access/generic_xlog.h" #include "access/parallel.h" #include "access/reloptions.h" +#include "lib/pairingheap.h" #include "nodes/execnodes.h" #include "port.h" /* for random() */ #include "utils/sampling.h" diff --git a/src/ivfscan.c b/src/ivfscan.c index 5f612db..5e69c39 100644 --- a/src/ivfscan.c +++ b/src/ivfscan.c @@ -5,6 +5,7 @@ #include "access/relscan.h" #include "catalog/pg_operator_d.h" #include "catalog/pg_type_d.h" +#include "lib/pairingheap.h" #include "ivfflat.h" #include "miscadmin.h" #include "pgstat.h"