Permalink
Browse files

for WIN32 compatibility

  • Loading branch information...
Heng Li
Heng Li committed Jul 7, 2011
1 parent 00438f1 commit 70a52501bcfa63824749893a5ab8ed3c38e34958
Showing with 14 additions and 0 deletions.
  1. +5 −0 bcftools/bcfutils.c
  2. +5 −0 bcftools/call1.c
  3. +4 −0 bedidx.c
View
@@ -5,6 +5,11 @@
#include "khash.h"
KHASH_MAP_INIT_STR(str2id, int)
+#ifdef _WIN32
+#define srand48(x) srand(x)
+#define drand48() ((double)rand() / RAND_MAX)
+#endif
+
// FIXME: valgrind report a memory leak in this function. Probably it does not get deallocated...
void *bcf_build_refhash(bcf_hdr_t *h)
{
View
@@ -8,6 +8,11 @@
#include "kstring.h"
#include "time.h"
+#ifdef _WIN32
+#define srand48(x) srand(x)
+#define drand48() ((double)rand() / RAND_MAX)
+#endif
+
#include "kseq.h"
KSTREAM_INIT(gzFile, gzread, 16384)
View
@@ -4,6 +4,10 @@
#include <stdio.h>
#include <zlib.h>
+#ifdef _WIN32
+#define drand48() ((double)rand() / RAND_MAX)
+#endif
+
#include "ksort.h"
KSORT_INIT_GENERIC(uint64_t)

0 comments on commit 70a5250

Please sign in to comment.