summaryrefslogtreecommitdiff
path: root/lib/ruby
diff options
context:
space:
mode:
authorMatthias Kramm <kramm@quiss.org>2010-04-06 11:13:34 -0700
committerMatthias Kramm <kramm@quiss.org>2010-04-06 11:13:34 -0700
commitdf99e9de2273822d54a2efa8d02a08e90181ede1 (patch)
tree0f1c3c3388c8bc5a0a502455dd1191bce20a83ff /lib/ruby
parentbd6e5cd809f4fa605f8505fa06712981b3443537 (diff)
seed random from ruby interface
Diffstat (limited to 'lib/ruby')
-rw-r--r--lib/ruby/gfx.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ruby/gfx.c b/lib/ruby/gfx.c
index 32274493..7c48a093 100644
--- a/lib/ruby/gfx.c
+++ b/lib/ruby/gfx.c
@@ -1,4 +1,5 @@
#include <ruby.h>
+#include "../../config.h"
#include "../gfxdevice.h"
#include "../gfxsource.h"
#include "../gfxtools.h"
@@ -765,6 +766,14 @@ VALUE gfx_setparameter(VALUE module, VALUE _key, VALUE _value)
void Init_gfx()
{
initLog(0,0,0,0,0,2);
+#ifdef HAVE_SRAND48
+ srand48(time(0));
+#else
+#ifdef HAVE_SRAND
+ srand(time(0));
+#endif
+#endif
+
pdfdriver = gfxsource_pdf_create();
swfdriver = gfxsource_swf_create();
imagedriver = gfxsource_image_create();