From 482570e978718d92207bd177d26f3bf6535bad31 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 3 Sep 2024 13:29:07 -0500 Subject: [PATCH] fix: show clear error message on older libcurl Closes https://github.com/supabase/pg_net/issues/143 --- Makefile | 2 +- src/worker.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c53ff7a..64c9782 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PG_CFLAGS = -Werror -Wno-declaration-after-statement +PG_CFLAGS = -std=c11 -Werror -Wno-declaration-after-statement EXTENSION = pg_net EXTVERSION = 0.9.3 diff --git a/src/worker.c b/src/worker.c index 05bc769..b049aa9 100644 --- a/src/worker.c +++ b/src/worker.c @@ -25,6 +25,10 @@ #include "util.h" +#define MIN_LIBCURL_VERSION_NUM 0x075300 // This is the 7.83.0 version in hex as defined in curl/curlver.h +_Static_assert(LIBCURL_VERSION_NUM, "libcurl >= 7.83.0 is required"); // test for older libcurl versions that don't even have LIBCURL_VERSION_NUM defined (e.g. libcurl 6.5). +_Static_assert(LIBCURL_VERSION_NUM >= MIN_LIBCURL_VERSION_NUM, "libcurl >= 7.83.0 is required"); + PG_MODULE_MAGIC; static char *guc_ttl = "6 hours";