fix for windows
authorMazet Laurent <laurent.mazet@thalesgroup.com>
Thu, 27 Nov 2025 17:14:15 +0000 (18:14 +0100)
committerMazet Laurent <laurent.mazet@thalesgroup.com>
Thu, 27 Nov 2025 17:14:15 +0000 (18:14 +0100)
Makerule.in
configure
configure.ac
src/trellis.c
src/trellis.h

index 9a70e4a1e52a55f72371f117b977f94e315a4a04..09f258eedb7ede4042856b8ee01a09ec5cbc48f2 100644 (file)
@@ -112,7 +112,7 @@ endif
 prog_%$(EXECEXT): %.o
        @echo "Creating program $@"
        @rm -f $@
-       @$(LINK) $< -lviterbi -o $(BIN_BUILD_DIR)/$@
+       @$(LINK) $< $(LIBS) -o $(BIN_BUILD_DIR)/$@
 ifneq (${DEBUG},true)
        @echo "Stripping program $@"
        @$(STRIP) $(BIN_BUILD_DIR)/$@
index ff47995471e443ab469003e2fd2b6a007dca8a21..a1f7113605dd1c1684910149fce295602b8c177b 100755 (executable)
--- a/configure
+++ b/configure
@@ -5039,7 +5039,7 @@ fi
 
 
 case "$host" in
-  *-*-cygwin*)
+  *-*-cygwin*|*-*-mingw*)
     SHARED_LIBS=false
     ;;
 esac
@@ -5073,7 +5073,7 @@ case "$host" in
     SH_LD=ld
     SH_LDFLAGS=-Bshareable
   ;;
-  *-*-cygwin*)
+  *-*-cygwin*|*-*-mingw*)
     EXECEXT=".exe"
   ;;
   *-*-linux*)
index 897ba5137f1680c9a05d2f0a9745e3613d9e06a6..486d512563d42a24b1079677a08a6ce651930c15 100644 (file)
@@ -174,10 +174,10 @@ AC_ARG_ENABLE(shared,
   SHARED_LIBS=true)
 AC_SUBST(SHARED_LIBS)
 
-dnl Some check for cygwin
+dnl Some check for cygwin/minwgw
 
 case "$host" in
-  *-*-cygwin*)
+  *-*-cygwin*|*-*-mingw*)
     SHARED_LIBS=false
     ;;
 esac
@@ -208,7 +208,7 @@ case "$host" in
     SH_LD=ld
     SH_LDFLAGS=-Bshareable
   ;;
-  *-*-cygwin*)
+  *-*-cygwin*|*-*-mingw*)
     EXECEXT=".exe"
   ;;
   *-*-linux*)
index e736710218ab28fe36b8a9bb8963a50480f7b5db..69e2ef60ff966b57457d0528eb0b31b29661abd1 100644 (file)
@@ -31,7 +31,6 @@ Open Source Initiative (www.opensource.org)
 #if !defined (__TRELLIS_C__)
 #define __TRELLIS_C__ 1
 
-#include <values.h>
 #include <malloc.h>
 #include <string.h>
 
index 69d6c09489ac2df3fb9ff74373b8c026ef80d7c7..f102bfab634cbf03a2c868653618428902ca0862 100644 (file)
@@ -39,9 +39,10 @@ extern const char *Viterbi_Version;
 const char *Viterbi_Version = VITERBIVERSION;
 #endif
 
+#include <float.h>
 /* metric type definition */
 typedef double metric_t;
-#define MAXMETRIC MAXDOUBLE
+#define MAXMETRIC DBL_MAX
 
 /* Trellis definition: 
  * ===================