aboutsummaryrefslogtreecommitdiff
path: root/redist/os_generic.h
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2018-06-23 12:11:33 -0400
committercnlohr <lohr85@gmail.com>2018-06-23 12:11:33 -0400
commit9291b950c5508513ea261059229e19760c050a47 (patch)
tree2cb0217e67896382c3bc395ad91d438c779a32cf /redist/os_generic.h
parent86bbd12c3889db3290e22ff61934ca1a218ce114 (diff)
parent87b6229f6fc4e434b9472e6c7722e40497ac97a1 (diff)
downloadlibsurvive-9291b950c5508513ea261059229e19760c050a47.tar.gz
libsurvive-9291b950c5508513ea261059229e19760c050a47.tar.bz2
Merge branch 'master' into new_config_system
Diffstat (limited to 'redist/os_generic.h')
-rw-r--r--redist/os_generic.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/redist/os_generic.h b/redist/os_generic.h
index 0d1c7e7..c0cb4f8 100644
--- a/redist/os_generic.h
+++ b/redist/os_generic.h
@@ -205,7 +205,7 @@ OSG_INLINE double OGGetFileTime(const char *file) {
}
OSG_INLINE og_thread_t OGCreateThread(void *(routine)(void *), void *parameter) {
- pthread_t *ret = malloc(sizeof(pthread_t));
+ pthread_t *ret = (pthread_t *)malloc(sizeof(pthread_t));
int r = pthread_create(ret, 0, routine, parameter);
if (r) {
free(ret);
@@ -268,26 +268,30 @@ OSG_INLINE void OGDeleteMutex(og_mutex_t om) {
}
OSG_INLINE og_sema_t OGCreateSema() {
- sem_t *sem = malloc(sizeof(sem_t));
+ sem_t *sem = (sem_t *)malloc(sizeof(sem_t));
sem_init(sem, 0, 0);
return (og_sema_t)sem;
}
OSG_INLINE int OGGetSema(og_sema_t os) {
int valp;
- sem_getvalue(os, &valp);
+ sem_getvalue((sem_t *)os, &valp);
return valp;
}
-OSG_INLINE void OGLockSema(og_sema_t os) { sem_wait(os); }
+OSG_INLINE void OGLockSema(og_sema_t os) { sem_wait((sem_t *)os); }
-OSG_INLINE void OGUnlockSema(og_sema_t os) { sem_post(os); }
+OSG_INLINE void OGUnlockSema(og_sema_t os) { sem_post((sem_t *)os); }
OSG_INLINE void OGDeleteSema(og_sema_t os) {
- sem_destroy(os);
+ sem_destroy((sem_t *)os);
free(os);
}
#endif
#endif
+
+#ifdef __cplusplus
+}
+#endif