summaryrefslogtreecommitdiff
path: root/camlibs/st2205
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2014-02-22 18:13:58 +0000
committerMarcus Meissner <marcus@jet.franken.de>2014-02-22 18:13:58 +0000
commit6992ccd80c8550b93ae6cca25df5f8a597d1e8d2 (patch)
tree930466fe86aedf79bceaca2736fdb035b46e65dd /camlibs/st2205
parentcbedc368861c4b969db1f66e721cef03c6802408 (diff)
downloadlibgphoto2-6992ccd80c8550b93ae6cca25df5f8a597d1e8d2.tar.gz
win32 has no rand_r, fallback to rand
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14785 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/st2205')
-rw-r--r--camlibs/st2205/st2205.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/camlibs/st2205/st2205.c b/camlibs/st2205/st2205.c
index 7d33ab41e..628d73c5b 100644
--- a/camlibs/st2205/st2205.c
+++ b/camlibs/st2205/st2205.c
@@ -671,8 +671,12 @@ st2205_write_file(Camera *camera,
unsigned char buf[camera->pl->width * camera->pl->height * 2];
int shuffle;
+#ifdef HAVE_RAND_R
shuffle = (long long)rand_r(&camera->pl->rand_seed) *
camera->pl->no_shuffles / (RAND_MAX + 1ll);
+#else
+ shuffle = (long long)rand() * camera->pl->no_shuffles / (RAND_MAX + 1ll);
+#endif
return st2205_real_write_file (camera, filename, rgb24, buf,
shuffle, 1);