freebsd-ports/multimedia/xbmc/files/patch-xbmc__linux__XThreadUtils.cpp
Bernhard Froehlich b7207fae88 - Update to 11.0b1
- Add fix to build fine with CLANG
- Remove USE_LDCONFIG because xbmc uses hardcoded paths

PR:		ports/163796
Submitted by:	Mickael Maillot <mickael.maillot@gmail.com> (maintainer)
2012-01-18 12:05:48 +00:00

46 lines
1.1 KiB
C++

--- ./xbmc/linux/XThreadUtils.cpp.orig 2011-12-23 04:12:21.000000000 +0100
+++ ./xbmc/linux/XThreadUtils.cpp 2012-01-02 10:14:38.000000000 +0100
@@ -38,7 +38,11 @@
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter,
DWORD dwCreationFlags,
+#ifdef __FreeBSD__
+ LPLONG lpThreadId
+#else
LPDWORD lpThreadId
+#endif
) {
// a thread handle would actually contain an event
@@ -62,8 +66,12 @@
pthread_attr_destroy(&attr);
if (h && lpThreadId)
+#ifdef __FreeBSD__
+ *lpThreadId = (LONG)h->m_hThread;
+#else
// WARNING: This can truncate thread IDs on x86_64.
*lpThreadId = (DWORD)h->m_hThread;
+#endif
return h;
}
@@ -89,10 +97,18 @@
int ( *start_address )( void * ),
void *arglist,
unsigned initflag,
+#ifdef __FreeBSD__
+ unsigned long *thrdaddr
+#else
unsigned *thrdaddr
+#endif
) {
+#ifdef __FreeBSD__
+ HANDLE h = CreateThread(NULL, stack_size, start_address, arglist, initflag, (LPLONG)thrdaddr);
+#else
HANDLE h = CreateThread(NULL, stack_size, start_address, arglist, initflag, (LPDWORD)thrdaddr);
+#endif
return h;
}