diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libstrongswan/credentials/sets/cert_cache.c | 1 | ||||
-rw-r--r-- | src/libstrongswan/tests/suites/test_threading.c | 1 | ||||
-rw-r--r-- | src/libstrongswan/tests/suites/test_watcher.c | 1 | ||||
-rw-r--r-- | src/libstrongswan/utils/utils.h | 1 | ||||
-rw-r--r-- | src/libstrongswan/utils/windows.h | 9 |
5 files changed, 10 insertions, 3 deletions
diff --git a/src/libstrongswan/credentials/sets/cert_cache.c b/src/libstrongswan/credentials/sets/cert_cache.c index e8f0e7ec0..563f4bdd5 100644 --- a/src/libstrongswan/credentials/sets/cert_cache.c +++ b/src/libstrongswan/credentials/sets/cert_cache.c @@ -16,7 +16,6 @@ #include "cert_cache.h" #include <time.h> -#include <sched.h> #include <library.h> #include <threading/rwlock.h> diff --git a/src/libstrongswan/tests/suites/test_threading.c b/src/libstrongswan/tests/suites/test_threading.c index 496310c8c..0526d9d6e 100644 --- a/src/libstrongswan/tests/suites/test_threading.c +++ b/src/libstrongswan/tests/suites/test_threading.c @@ -16,7 +16,6 @@ #include "test_suite.h" -#include <sched.h> #include <unistd.h> #include <threading/thread.h> diff --git a/src/libstrongswan/tests/suites/test_watcher.c b/src/libstrongswan/tests/suites/test_watcher.c index 451fa0b38..11b4c3a7d 100644 --- a/src/libstrongswan/tests/suites/test_watcher.c +++ b/src/libstrongswan/tests/suites/test_watcher.c @@ -17,7 +17,6 @@ #include <library.h> -#include <sched.h> #include <unistd.h> #include <errno.h> diff --git a/src/libstrongswan/utils/utils.h b/src/libstrongswan/utils/utils.h index c14b9c11e..ced47a4b8 100644 --- a/src/libstrongswan/utils/utils.h +++ b/src/libstrongswan/utils/utils.h @@ -36,6 +36,7 @@ # include <sys/socket.h> # include <netdb.h> # include <netinet/in.h> +# include <sched.h> #endif /** diff --git a/src/libstrongswan/utils/windows.h b/src/libstrongswan/utils/windows.h index 90c92fd60..83a6d6253 100644 --- a/src/libstrongswan/utils/windows.h +++ b/src/libstrongswan/utils/windows.h @@ -68,6 +68,15 @@ static inline void srandom(unsigned int seed) } /** + * Replacement of sched_yield(2) from <sched.h> + */ +static inline int sched_yield(void) +{ + Sleep(0); + return 0; +} + +/** * strdup(3), the Windows variant can't free(strdup("")) and others */ #define strdup strdup_windows |