32
32
#ifndef _WIN32
33
33
// #include <intrin.h>
34
34
35
- #define THREAD_RESULT void *
36
- #define THREAD_PARAM void *
35
+ #define THREAD_RESULT_TYPE void *
36
+ #define THREAD_PARAM_TYPE void *
37
+ #define THREAD_CALLING_CONVENTION
37
38
38
39
#include < stdio.h>
39
40
@@ -51,8 +52,9 @@ void de265_cond_wait(de265_cond* c,de265_mutex* m) { pthread_cond_wait(c,m); }
51
52
void de265_cond_signal (de265_cond* c) { pthread_cond_signal (c); }
52
53
#else // _WIN32
53
54
54
- #define THREAD_RESULT DWORD WINAPI
55
- #define THREAD_PARAM LPVOID
55
+ #define THREAD_RESULT_TYPE DWORD
56
+ #define THREAD_CALLING_CONVENTION WINAPI
57
+ #define THREAD_PARAM_TYPE LPVOID
56
58
57
59
int de265_thread_create (de265_thread* t, LPTHREAD_START_ROUTINE start_routine, void *arg) {
58
60
HANDLE handle = CreateThread (NULL , 0 , start_routine, arg, 0 , NULL );
@@ -184,7 +186,7 @@ void printblks(const thread_pool* pool)
184
186
#endif
185
187
186
188
187
- static THREAD_RESULT worker_thread (THREAD_PARAM pool_ptr)
189
+ static THREAD_RESULT_TYPE THREAD_CALLING_CONVENTION worker_thread (THREAD_PARAM_TYPE pool_ptr)
188
190
{
189
191
thread_pool* pool = (thread_pool*)pool_ptr;
190
192
@@ -210,7 +212,7 @@ static THREAD_RESULT worker_thread(THREAD_PARAM pool_ptr)
210
212
211
213
if (pool->stopped ) {
212
214
de265_mutex_unlock (&pool->mutex );
213
- return (THREAD_RESULT )0 ;
215
+ return (THREAD_RESULT_TYPE )0 ;
214
216
}
215
217
216
218
@@ -238,7 +240,7 @@ static THREAD_RESULT worker_thread(THREAD_PARAM pool_ptr)
238
240
}
239
241
de265_mutex_unlock (&pool->mutex );
240
242
241
- return (THREAD_RESULT )0 ;
243
+ return (THREAD_RESULT_TYPE )0 ;
242
244
}
243
245
244
246
0 commit comments