Build fixes for MinGW.

threads.h: use windows.h headers for clock stuff on MinGW
strategyselector.c: assert with strlen for MinGW support
This commit is contained in:
Ari Lemmetti 2014-11-12 16:31:55 +02:00
parent a4efbbe680
commit 56c537e145
2 changed files with 5 additions and 4 deletions

View file

@ -121,9 +121,10 @@ static void* strategyselector_choose_for(const strategy_list * const strategies,
char *override = NULL;
int i = 0;
// Because VS doesn't support snprintf, let's just assert that there is more
// than enough room.
assert(strnlen(strategy_type, 200));
// Because VS doesn't support snprintf, let's assert that there is
// enough room in the buffer. Max length for strategy type is
// buffersize (256) - prefix including terminating zero.
assert(strlen(strategy_type) < 256 - sizeof("KVAZAAR_OVERRIDE_") );
sprintf(buffer, "KVAZAAR_OVERRIDE_%s", strategy_type);
override = getenv(buffer);

View file

@ -23,7 +23,7 @@
#include <pthread.h>
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__MINGW32__)
#include <unistd.h>
#include <time.h>