diff options
| author | 2024-01-16 21:08:04 -0500 | |
|---|---|---|
| committer | 2024-01-16 21:08:04 -0500 | |
| commit | 639050bb884a10b892005d678c16d8167246be83 (patch) | |
| tree | 4ffc62ef7ba65b5e2c087ce9a5e4479ed61156ae /subprojects/packagefiles | |
| parent | e2fb1d3a5f8b810eaefbff469cfcb3eddad7cbf3 (diff) | |
| download | libnaunet-639050bb884a10b892005d678c16d8167246be83.tar.gz libnaunet-639050bb884a10b892005d678c16d8167246be83.tar.bz2 libnaunet-639050bb884a10b892005d678c16d8167246be83.zip | |
More windows build fixes
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'subprojects/packagefiles')
| -rw-r--r-- | subprojects/packagefiles/libev/libev_aki_sleep.diff | 37 | ||||
| -rw-r--r-- | subprojects/packagefiles/libev/libev_aki_sleep_no_monotonic.diff | 60 |
2 files changed, 60 insertions, 37 deletions
diff --git a/subprojects/packagefiles/libev/libev_aki_sleep.diff b/subprojects/packagefiles/libev/libev_aki_sleep.diff deleted file mode 100644 index f41b96d..0000000 --- a/subprojects/packagefiles/libev/libev_aki_sleep.diff +++ /dev/null @@ -1,37 +0,0 @@ ---- ev.c 2020-03-18 08:27:32.000000000 -0400 -+++ ../ev.c 2023-09-21 16:15:10.219097499 -0400 -@@ -216,6 +216,8 @@ - - #include <signal.h> - -+#include <aki/thread.h> -+ - #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/libev_aki_sleep_no_monotonic.diff b/subprojects/packagefiles/libev/libev_aki_sleep_no_monotonic.diff new file mode 100644 index 0000000..2080116 --- /dev/null +++ b/subprojects/packagefiles/libev/libev_aki_sleep_no_monotonic.diff @@ -0,0 +1,60 @@ +--- 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 <signal.h> + ++#include <aki/thread.h> ++ + #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 <sys/syscall.h> ++# include <unistd.h> + # 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) + { |