fix for windows master
authorMazet Laurent <laurent.mazet@thalesgroup.com>
Thu, 27 Nov 2025 18:12:43 +0000 (19:12 +0100)
committerMazet Laurent <laurent.mazet@thalesgroup.com>
Thu, 27 Nov 2025 18:12:43 +0000 (19:12 +0100)
src/fbtrellis.c
test/convcode.c

index 2e24d56690bfe5c879344a614d74269b1eef0144..b5ed3b337c83a48846fd12d96167935ac8b37310 100644 (file)
@@ -9,7 +9,7 @@ Copyright (C) 2004 Laurent Mazet and Sebastien Simoens
 #if !defined (__FBTRELLIS_C__)
 #define __FBTRELLIS_C__ 1
 
-#include <values.h>
+#include <float.h>
 #include <malloc.h>
 #include <math.h>
 #include "fbtrellis.h"
index 356eeae2ddd9dc4e956dcdfea9bf79e625d11b3b..4778a362081e3078c2b0c2752079139eb31d88e6 100644 (file)
@@ -32,6 +32,12 @@ Copyright (C) 2003 Laurent Mazet
 
 typedef char bit;
 
+#if !(_SVID_SOURCE || _XOPEN_SOURCE)
+double drand48(void) {
+    return rand() / (RAND_MAX + 1.0);
+}
+#endif
+
 /* Pseudo-random bit sequence */
 void bit_gene (bit * a, int n) {
   int i;