Skip to content

Commit a7aeb23

Browse files
committed
Use correct define and fix types in threadwrapper
1 parent 1eeccb3 commit a7aeb23

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: src/threadqueue.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ threadqueue_queue_t * kvz_threadqueue_init(int thread_count)
389389
threadqueue->first = NULL;
390390
threadqueue->last = NULL;
391391

392-
#ifndef _WIN32
392+
#ifndef _MSC_VER
393393
pthread_attr_t attr;
394394
if (pthread_attr_init(&attr) != 0) {
395395
fprintf(stderr, "pthread_attr_init failed!\n");
@@ -407,7 +407,7 @@ threadqueue_queue_t * kvz_threadqueue_init(int thread_count)
407407
}
408408
}
409409
#else
410-
pthread_attr_t* attr;
410+
pthread_attr_t attr;
411411
#endif
412412

413413
// Lock the queue before creating threads, to ensure they all have correct information.
@@ -425,7 +425,7 @@ threadqueue_queue_t * kvz_threadqueue_init(int thread_count)
425425
return threadqueue;
426426

427427
failed:
428-
#ifndef _WIN32
428+
#ifndef _MSC_VER
429429
if (pthread_attr_destroy(&attr) != 0) {
430430
fprintf(stderr, "pthread_attr_destroy failed!\n");
431431
}

Diff for: src/threadwrapper/include/pthread.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ typedef void* pthread_rwlock_t;
2727
typedef void* pthread_t;
2828
typedef void*(voidp_voidp_func)(void*);
2929

30-
typedef void pthread_attr_t;
31-
typedef void pthread_condattr_t;
32-
typedef void pthread_mutexattr_t;
33-
typedef void pthread_rwlockattr_t;
30+
typedef void* pthread_attr_t;
31+
typedef void* pthread_condattr_t;
32+
typedef void* pthread_mutexattr_t;
33+
typedef void* pthread_rwlockattr_t;
3434

3535
// Parameter names that have been commented away do nothing,
3636
// as they are always null when the functions are used in Kvazaar.

0 commit comments

Comments
 (0)