Files
MINGW-packages/mingw-w64-rtmpdump-git/0003-better-w32-threading.all.patch
2014-03-12 15:35:07 +04:00

33 lines
883 B
Diff

--- rtmpdump/thread.c.orig 2014-03-02 18:20:23.000000000 +0000
+++ rtmpdump/thread.c 2014-03-12 09:20:02.337444200 +0000
@@ -30,10 +30,14 @@
ThreadCreate(thrfunc *routine, void *args)
{
HANDLE thd;
+ uintptr_t success;
- thd = (HANDLE) _beginthread(routine, 0, args);
- if (thd == -1L)
+ success = _beginthreadex(NULL, 0, routine, args, 0, (unsigned *)&thd);
+ if (!success)
+ {
RTMP_LogPrintf("%s, _beginthread failed with %d\n", __FUNCTION__, errno);
+ return INVALID_HANDLE_VALUE;
+ }
return thd;
}
--- rtmpdump/thread.h.orig 2014-03-02 18:20:23.000000000 +0000
+++ rtmpdump/thread.h 2014-03-12 09:22:17.183567500 +0000
@@ -25,8 +25,8 @@
#ifdef WIN32
#include <windows.h>
#include <process.h>
-#define TFTYPE void
-#define TFRET()
+#define TFTYPE unsigned int __stdcall
+#define TFRET() return 0
#define THANDLE HANDLE
#else
#include <pthread.h>