From 0b3dc0887f9669312ebf63c35b9a8e08385fd0fd Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 23 Feb 2023 14:08:27 -0800 Subject: [PATCH] Fixed compilation with Postgres 16 - fixes #61 --- src/vector.c | 2 +- src/vector.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vector.c b/src/vector.c index d232a23..fa5cbca 100644 --- a/src/vector.c +++ b/src/vector.c @@ -822,7 +822,7 @@ vector_accum(PG_FUNCTION_ARGS) if (newarr) { for (int i = 0; i < dim; i++) - statedatums[i + 1] = Float8GetDatumFast(x[i]); + statedatums[i + 1] = Float8GetDatumFast((double) x[i]); } else { diff --git a/src/vector.h b/src/vector.h index 3e41130..93aeb6a 100644 --- a/src/vector.h +++ b/src/vector.h @@ -3,6 +3,10 @@ #include "postgres.h" +#if PG_VERSION_NUM >= 160000 +#include "varatt.h" +#endif + #define VECTOR_MAX_DIM 16000 #define VECTOR_SIZE(_dim) (offsetof(Vector, x) + sizeof(float)*(_dim))