From 159db01883ae7e058d1102b8fd0ab7dba95c9d33 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Mon, 25 Nov 2024 10:40:00 -0500 Subject: Android build, packet stream fixes Signed-off-by: Andrew Opalach --- subprojects/libev.wrap | 2 +- .../libev/libev_aki_sleep_no_monotonic.diff | 60 ---------------------- .../packagefiles/libev/libev_aki_thread_sleep.diff | 37 +++++++++++++ subprojects/packagefiles/libev/no_monotonic.diff | 16 ++++++ 4 files changed, 54 insertions(+), 61 deletions(-) delete mode 100644 subprojects/packagefiles/libev/libev_aki_sleep_no_monotonic.diff create mode 100644 subprojects/packagefiles/libev/libev_aki_thread_sleep.diff create mode 100644 subprojects/packagefiles/libev/no_monotonic.diff (limited to 'subprojects') diff --git a/subprojects/libev.wrap b/subprojects/libev.wrap index 02b8df5..56b5299 100644 --- a/subprojects/libev.wrap +++ b/subprojects/libev.wrap @@ -6,7 +6,7 @@ source_filename = libev-4.33.tar.gz source_hash = 507eb7b8d1015fbec5b935f34ebed15bf346bed04a11ab82b8eee848c4205aea patch_directory = libev -diff_files = libev/libev_aki_sleep_no_monotonic.diff, libev/no_extern_on_init.diff +diff_files = libev/libev_aki_thread_sleep.diff, libev/no_extern_on_init.diff, libev/no_monotonic.diff [provide] dependency_names = libev diff --git a/subprojects/packagefiles/libev/libev_aki_sleep_no_monotonic.diff b/subprojects/packagefiles/libev/libev_aki_sleep_no_monotonic.diff deleted file mode 100644 index 2080116..0000000 --- a/subprojects/packagefiles/libev/libev_aki_sleep_no_monotonic.diff +++ /dev/null @@ -1,60 +0,0 @@ ---- a/ev.c 2020-03-18 08:27:32.000000000 -0400 -+++ b/ev.c 2024-01-16 15:42:39.360703755 -0400 -@@ -216,6 +216,8 @@ - - #include - -+#include -+ - #ifdef EV_H - # include EV_H - #else -@@ -437,7 +439,7 @@ - /* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */ - /* which makes programs even slower. might work on other unices, too. */ - #if EV_USE_CLOCK_SYSCALL --# include -+# include - # ifdef SYS_clock_gettime - # define clock_gettime(id, ts) syscall (SYS_clock_gettime, (id), (ts)) - # undef EV_USE_MONOTONIC -@@ -2216,24 +2218,7 @@ - { - if (delay > EV_TS_CONST (0.)) - { --#if EV_USE_NANOSLEEP -- struct timespec ts; -- -- EV_TS_SET (ts, delay); -- nanosleep (&ts, 0); --#elif defined _WIN32 -- /* maybe this should round up, as ms is very low resolution */ -- /* compared to select (µs) or nanosleep (ns) */ -- Sleep ((unsigned long)(EV_TS_TO_MSEC (delay))); --#else -- struct timeval tv; -- -- /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */ -- /* something not guaranteed by newer posix versions, but guaranteed */ -- /* by older ones */ -- EV_TV_SET (tv, delay); -- select (0, 0, 0, 0, &tv); --#endif -+ aki_thread_sleep (delay); - } - } - -@@ -4100,11 +4085,13 @@ - waittime = EV_TS_CONST (MAX_BLOCKTIME2); - #endif - #if !EV_PERIODIC_ENABLE -+#if EV_USE_MONOTONIC - /* without periodics but with monotonic clock there is no need */ - /* for any time jump detection, so sleep longer */ - if (ecb_expect_true (have_monotonic)) - waittime = EV_TS_CONST (MAX_BLOCKTIME2); - #endif -+#endif - - if (timercnt) - { diff --git a/subprojects/packagefiles/libev/libev_aki_thread_sleep.diff b/subprojects/packagefiles/libev/libev_aki_thread_sleep.diff new file mode 100644 index 0000000..59d197c --- /dev/null +++ b/subprojects/packagefiles/libev/libev_aki_thread_sleep.diff @@ -0,0 +1,37 @@ +--- a/ev.c 2020-03-18 08:27:32.000000000 -0400 ++++ b/ev.c 2024-01-16 15:42:39.360703755 -0400 +@@ -216,6 +216,8 @@ + + #include + ++#include ++ + #ifdef EV_H + # include EV_H + #else +@@ -2216,24 +2218,7 @@ + { + if (delay > EV_TS_CONST (0.)) + { +-#if EV_USE_NANOSLEEP +- struct timespec ts; +- +- EV_TS_SET (ts, delay); +- nanosleep (&ts, 0); +-#elif defined _WIN32 +- /* maybe this should round up, as ms is very low resolution */ +- /* compared to select (µs) or nanosleep (ns) */ +- Sleep ((unsigned long)(EV_TS_TO_MSEC (delay))); +-#else +- struct timeval tv; +- +- /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */ +- /* something not guaranteed by newer posix versions, but guaranteed */ +- /* by older ones */ +- EV_TV_SET (tv, delay); +- select (0, 0, 0, 0, &tv); +-#endif ++ aki_thread_sleep (delay); + } + } + diff --git a/subprojects/packagefiles/libev/no_monotonic.diff b/subprojects/packagefiles/libev/no_monotonic.diff new file mode 100644 index 0000000..382c241 --- /dev/null +++ b/subprojects/packagefiles/libev/no_monotonic.diff @@ -0,0 +1,16 @@ +--- a/ev.c 2020-03-18 08:27:32.000000000 -0400 ++++ b/ev.c 2024-01-16 15:42:39.360703755 -0400 +@@ -4100,11 +4085,13 @@ + waittime = EV_TS_CONST (MAX_BLOCKTIME2); + #endif + #if !EV_PERIODIC_ENABLE ++#if EV_USE_MONOTONIC + /* without periodics but with monotonic clock there is no need */ + /* for any time jump detection, so sleep longer */ + if (ecb_expect_true (have_monotonic)) + waittime = EV_TS_CONST (MAX_BLOCKTIME2); + #endif ++#endif + + if (timercnt) + { -- cgit v1.2.3-101-g0448