From aa2a55c883d1a75cdf6441f9fcb94df6d2dddd05 Mon Sep 17 00:00:00 2001 From: Kevin Reinholz Date: Thu, 15 Oct 2026 17:18:36 -0700 Subject: [PATCH] Add curl support to naett on FreeBSD. (Unbreaks build on dirty/live systems where curl is installed and passes find_package() check). --- ext/naett-lib/src/naett_curl.c | 2 +- ext/naett-lib/src/naett_internal.h | 6 +++++- ext/naett-lib/src/naett_linux.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ext/naett-lib/src/naett_curl.c b/ext/naett-lib/src/naett_curl.c index da798fc53c..53e8b62d3a 100644 --- a/ext/naett-lib/src/naett_curl.c +++ b/ext/naett-lib/src/naett_curl.c @@ -1,6 +1,6 @@ // PPSSPP addition - not part of upstream naett. See naett_curl.h. -#if __linux__ && !__ANDROID__ +#if (__linux__ || defined(__FreeBSD__)) && !__ANDROID__ #define NAETT_CURL_INTERNAL #include "naett_curl.h" diff --git a/ext/naett-lib/src/naett_internal.h b/ext/naett-lib/src/naett_internal.h index 17c7147e49..45131b98e8 100644 --- a/ext/naett-lib/src/naett_internal.h +++ b/ext/naett-lib/src/naett_internal.h @@ -27,6 +27,10 @@ #include #endif +#ifdef __FreeBSD__ +#include +#endif + #if __ANDROID__ #include #include @@ -102,7 +106,7 @@ typedef struct { pthread_t workerThread; int closeRequested; #endif -#if __LINUX__ +#if __LINUX__ || defined(__FreeBSD__) struct curl_slist* headerList; #endif #if __WINDOWS__ diff --git a/ext/naett-lib/src/naett_linux.c b/ext/naett-lib/src/naett_linux.c index 112a8bc76f..b1fc783139 100644 --- a/ext/naett-lib/src/naett_linux.c +++ b/ext/naett-lib/src/naett_linux.c @@ -1,6 +1,6 @@ #include "naett_internal.h" -#if __linux__ && !__ANDROID__ +#if (__linux__ || defined(__FreeBSD__)) && !__ANDROID__ // PPSSPP: libcurl is dlopen'd rather than linked, see naett_curl.h. This header stands in // for and redirects the curl_* calls below through function pointers.