diff options
author | Paul Duncan <pabs@pablotron.org> | 2019-02-09 06:34:38 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2019-02-09 06:34:38 -0500 |
commit | 0f9b8cbe1419e30fee5277de4e7254591c39ac2f (patch) | |
tree | d380934693fd6d1559859227f6bd64cc4496d4b7 | |
parent | ea56aca669d38f9f810d48f83556fe02c66d54c1 (diff) | |
download | kmeans-master.tar.bz2 kmeans-master.zip |
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | src/km-rand-erand48.c | 13 |
2 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,7 @@ +# to cross-compile: +# WIN32_APP=km-test.exe +# WIN32_CC=x86_64-w64-mingw32-gcc +# WIN32_CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O2 -D__USE_MINGW_ANSI_STDIO=1 APP=km-test CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O2 -fopenmp OBJS=src/km-set.o src/km-draw.o src/km-load.o src/km-find.o \ diff --git a/src/km-rand-erand48.c b/src/km-rand-erand48.c index 3d7b02d..544a77c 100644 --- a/src/km-rand-erand48.c +++ b/src/km-rand-erand48.c @@ -4,6 +4,17 @@ #include "util.h" #include "km.h" +#ifdef _WIN32 +bool +km_rand_init_erand48( + km_rand_t * const rs, + const uint64_t seed +) { + srand(seed); + km_rand_init_libc(rs); + return true; +} +#else /* !_WIN32 */ // get N get_floats static bool on_get_floats( @@ -87,3 +98,5 @@ km_rand_init_erand48( // return success return true; } + +#endif /* _WIN32 */ |