slackbuilds_ponce/development/maude/32-bit-fixes.patch
B. Watson c96ceb1745
development/maude: Fix 32-bit build.
Signed-off-by: B. Watson <yalhcru@gmail.com>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2022-03-26 01:20:11 +07:00

34 lines
950 B
Diff

--- a/src/BuiltIn/succSymbol.hh
+++ b/src/BuiltIn/succSymbol.hh
@@ -46,6 +46,15 @@
Vector<Term*>& terms);
void postInterSymbolPass();
void reset();
+
+#if SIZEOF_LONG < 8
+ DagNode* makeNatDag(Int64 nat)
+ {
+ mpz_class bigNat;
+ mpz_import(bigNat.get_mpz_t(), 1, 1, sizeof(nat), 0, 0, &nat);
+ return makeNatDag(bigNat);
+ }
+#endif
//
// Functions special to SuccSymbol.
//
--- a/src/Meta/interpreterManagerSymbol.cc
+++ b/src/Meta/interpreterManagerSymbol.cc
@@ -599,6 +599,12 @@
DagNode*
InterpreterManagerSymbol::upRewriteCount(const RewritingContext* context)
{
- mpz_class totalCount(context->getTotalCount());
+#if SIZEOF_LONG == 8
+ mpz_class totalCount(context->getTotalCount());
+#else
+ Int64 totalCount64 = context->getTotalCount();
+ mpz_class totalCount;
+ mpz_import(totalCount.get_mpz_t(), 1, 1, sizeof(totalCount64), 0, 0, &totalCount64);
+#endif
return metaLevel->upNat(totalCount);
}