summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorrpj <rpj>1999-11-04 17:18:43 +0000
committerrpj <rpj>1999-11-04 17:18:43 +0000
commit7fdb900bc169f0105bf5fb2cd282f6448f3f11f7 (patch)
tree3f3c80cb9efa420e259c407a28b77713985ca23b /misc.c
parentefa438832bc1343c08c334e88aec4266040ddec3 (diff)
1999-11-05 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* general: Patched for portability to WinCE. The details are described in the file WinCE-PORT. Follow the instructions in README.WinCE to make the appropriate changes in config.h. - Tristan Savatier <tristan@mpegtv.com>
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/misc.c b/misc.c
index 208541a..84dc6eb 100644
--- a/misc.c
+++ b/misc.c
@@ -163,6 +163,10 @@ pthread_self (void)
self->thread = GetCurrentThreadId ();
+#ifdef NEED_DUPLICATEHANDLE
+ /* DuplicateHandle does not exist on WinCE */
+ self->threadH = GetCurrentThread();
+#else
if( !DuplicateHandle(
GetCurrentProcess(),
GetCurrentThread(),
@@ -175,6 +179,7 @@ pthread_self (void)
free( self );
return (NULL);
}
+#endif
}
pthread_setspecific (_pthread_selfThreadKey, self);
@@ -361,4 +366,17 @@ pthreadCancelableTimedWait (HANDLE waitHandle, DWORD timeout)
return (CancelableWait(waitHandle, timeout));
}
-
+#ifdef NEED_CALLOC
+void
+*_pthread_calloc(size_t n, size_t s) {
+ unsigned int m = n*s;
+ void *p;
+
+ p = malloc(m);
+ if (p == NULL) return NULL;
+
+ memset(p, 0, m);
+
+ return p;
+}
+#endif