From 9fcff7455327a29ccfc8fa9d9b88fa0dc2c9ca49 Mon Sep 17 00:00:00 2001 From: dcommander Date: Fri, 15 Jul 2011 09:55:36 +0000 Subject: Windows doesn't have random() git-svn-id: https://libjpeg-turbo.svn.sourceforge.net/svnroot/libjpeg-turbo@671 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- branches/1.1.x/jpegut.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'branches') diff --git a/branches/1.1.x/jpegut.c b/branches/1.1.x/jpegut.c index 00fcdad..e46e97a 100644 --- a/branches/1.1.x/jpegut.c +++ b/branches/1.1.x/jpegut.c @@ -20,6 +20,9 @@ #include "./turbojpeg.h" #ifndef _WIN32 #define stricmp strcasecmp +#else + #include + #define random() rand() #endif #define _catch(f) {if((f)==-1) {printf("TJPEG: %s\n", tjGetErrorStr()); bailout();}} @@ -565,6 +568,9 @@ void dotest1(void) int main(int argc, char *argv[]) { int doyuv=0; + #ifdef _WIN32 + srand((unsigned int)time(NULL)); + #endif if(argc>1 && !stricmp(argv[1], "-yuv")) doyuv=1; if(doyuv) yuv=YUVENCODE; dotest(35, 39, 3, TJ_444, "test"); -- cgit v1.2.3