forked from pool/openfst
Jan Engelhardt
72119ee4ca
OBS-URL: https://build.opensuse.org/package/show/science/openfst?expand=0&rev=3
43 lines
1.5 KiB
Diff
43 lines
1.5 KiB
Diff
From: Jan Engelhardt <jengelh@inai.de>
|
|
Date: 2022-04-14 16:00:12.633272404 +0200
|
|
|
|
Modeled upon a similar patch for opensuse's ICU package.
|
|
|
|
---
|
|
configure.ac | 4 ++--
|
|
src/include/fst/float-weight.h | 4 +++-
|
|
2 files changed, 5 insertions(+), 3 deletions(-)
|
|
|
|
Index: openfst-1.8.3/configure.ac
|
|
===================================================================
|
|
--- openfst-1.8.3.orig/configure.ac
|
|
+++ openfst-1.8.3/configure.ac
|
|
@@ -160,10 +160,10 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([
|
|
#include <cstdio>
|
|
|
|
template <typename T>
|
|
- bool FloatEqIsReflexive(T m) {
|
|
+ bool FloatEqIsReflexive(volatile T m) {
|
|
volatile T x = 1.111;
|
|
x *= m;
|
|
- T y = 1.111;
|
|
+ volatile T y = 1.111;
|
|
y *= m;
|
|
return x == y;
|
|
}
|
|
Index: openfst-1.8.3/src/include/fst/float-weight.h
|
|
===================================================================
|
|
--- openfst-1.8.3.orig/src/include/fst/float-weight.h
|
|
+++ openfst-1.8.3/src/include/fst/float-weight.h
|
|
@@ -121,7 +121,9 @@ constexpr bool operator==(const FloatWei
|
|
// register may cause it to compare unequal to that same weight when
|
|
// stored to memory. This breaks =='s reflexivity, in turn breaking
|
|
// NaturalLess.
|
|
-#error "Please compile with -msse -mfpmath=sse, or equivalent."
|
|
+// So, store it in memory.
|
|
+ volatile T a = w1.Value(), b = w2.Value();
|
|
+ return a == b;
|
|
#endif
|
|
return w1.Value() == w2.Value();
|
|
}
|