aboutsummaryrefslogtreecommitdiff
path: root/src/osx_compatibility.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/osx_compatibility.h')
-rw-r--r--src/osx_compatibility.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/osx_compatibility.h b/src/osx_compatibility.h
new file mode 100644
index 0000000..a4f3924
--- /dev/null
+++ b/src/osx_compatibility.h
@@ -0,0 +1,20 @@
1#ifndef OSX_COMPATIBILITY__H
2#define OSX_COMPATIBILITY__H
3
4#ifdef __APPLE__
5
6#ifndef TEMP_FAILURE_RETRY
7#define TEMP_FAILURE_RETRY(expression) \
8 (__extension__ \
9 ({ long int __result; \
10 do __result = (long int) (expression); \
11 while (__result == -1L && errno == EINTR); \
12 __result; }))
13#endif
14
15#include <sched.h>
16
17#define pthread_yield() sched_yield()
18#endif /* __APPLE__ */
19#endif
20