Skip to content

Commit

Permalink
fix #2 missing random function on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
gerlachs committed Jun 24, 2018
1 parent 0051682 commit cb56859
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backend/nsl/nsl_sf_basic.c
Expand Up @@ -42,10 +42,11 @@
double nsl_sf_rand(void) { return rand(); }
#if defined(_MSC_VER) // MSVC has no random() function
double nsl_sf_random(void) { return rand(); }
double nsl_sf_drand(void) { return rand()/(double)RAND_MAX; }
#else
double nsl_sf_random(void) { return random(); }
#endif
double nsl_sf_drand(void) { return random()/(double)RAND_MAX; }
#endif

double nsl_sf_sgn(double x) {
#ifndef _WIN32
Expand Down

0 comments on commit cb56859

Please sign in to comment.