From babd3feb063dda8c0b8fb82b76c32b6cbad80190 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Fri, 11 Sep 2026 13:50:35 +0800 Subject: [PATCH] Isolate libuv platform headers and declare test string functions --- src/ss_event.c | 1 + src/ss_event.h | 5 +++-- tests/test_event.c | 2 ++ tests/test_resolv_async.c | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ss_event.c b/src/ss_event.c index b0470f2d..5ff2b7bc 100644 --- a/src/ss_event.c +++ b/src/ss_event.c @@ -1,4 +1,5 @@ #include "ss_event.h" +#include #include "uthash.h" #include #include diff --git a/src/ss_event.h b/src/ss_event.h index 47ba9081..a92bd103 100644 --- a/src/ss_event.h +++ b/src/ss_event.h @@ -3,7 +3,8 @@ #ifndef SS_EVENT_H #define SS_EVENT_H #include -#include +/* Keep platform headers private: Linux TCP headers differ from libc headers. */ +struct uv_loop_s; struct ss_loop; typedef double ss_tstamp; #define SS_READ 1 @@ -36,7 +37,7 @@ typedef struct ss_signal { struct ss_loop *ss_default_loop(void); struct ss_loop *ss_loop_new(unsigned flags); void ss_loop_destroy(struct ss_loop *loop); -uv_loop_t *ss_native_loop(struct ss_loop *loop); +struct uv_loop_s *ss_native_loop(struct ss_loop *loop); const char *ss_backend_name(void); int ss_run(struct ss_loop *loop, int flags); void ss_unloop(struct ss_loop *loop, int how); diff --git a/tests/test_event.c b/tests/test_event.c index c5bfa016..ab250dd7 100644 --- a/tests/test_event.c +++ b/tests/test_event.c @@ -1,5 +1,7 @@ #include "test_helpers.h" +#include #include "ss_event.h" +#include #ifdef __APPLE__ #include #endif diff --git a/tests/test_resolv_async.c b/tests/test_resolv_async.c index 1d5c2cd2..164af217 100644 --- a/tests/test_resolv_async.c +++ b/tests/test_resolv_async.c @@ -1,5 +1,6 @@ /* Local delayed DNS server proves A/AAAA/NXDOMAIN completion without blocking. */ #include "test_helpers.h" +#include #include "ss_event.h" #include "resolv.h" int verbose = 0;