diff --git a/cthreads.c b/cthreads.c index dea3270..5d0a799 100644 --- a/cthreads.c +++ b/cthreads.c @@ -136,7 +136,11 @@ void cthreads_thread_exit(void *code) { #endif #ifdef _WIN32 - #if defined __WATCOMC__ || _MSC_VER || __DMC__ + /* NOTE: This gives warnings on MSVC, so I removed this + * for the oldest version of it I could test (19.20). */ + /* TODO: Test with the other described compilers if this + * is _really_ necessary. */ + #if defined __WATCOMC__ || _MSC_VER < 1920 || __DMC__ ExitThread((DWORD)code); #else ExitThread((DWORD)(uintptr_t)code); @@ -323,6 +327,7 @@ int cthreads_cond_destroy(struct cthreads_cond *cond) { #endif #ifdef _WIN32 + (void) cond; return 0; #else return pthread_cond_destroy(&cond->pCond); diff --git a/cthreads.h b/cthreads.h index 634691b..8021f15 100644 --- a/cthreads.h +++ b/cthreads.h @@ -7,6 +7,8 @@ struct cthreads_args { }; #ifdef _WIN32 + /* MSVC sees strncpy() as insecure. */ + #define _CRT_SECURE_NO_WARNINGS #include #define CTHREADS_SEMAPHORE 1 #else