summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Hill <dirtyepic@gentoo.org>2009-02-10 05:01:37 +0000
committerRyan Hill <dirtyepic@gentoo.org>2009-02-10 05:01:37 +0000
commitfd02e44e9b969de0ea6ccc2ff33339031dabab86 (patch)
tree3c0f86767606c29c20b50da5933ee221c998717c /dev-lang/maude/files
parentstable sparc, bug 255848 (diff)
downloadgentoo-2-fd02e44e9b969de0ea6ccc2ff33339031dabab86.tar.gz
gentoo-2-fd02e44e9b969de0ea6ccc2ff33339031dabab86.tar.bz2
gentoo-2-fd02e44e9b969de0ea6ccc2ff33339031dabab86.zip
Fix building with GCC 4.3 for bug #227529
(Portage version: 2.2_rc23/cvs/Linux x86_64)
Diffstat (limited to 'dev-lang/maude/files')
-rw-r--r--dev-lang/maude/files/maude-2.3.0-gcc43.patch107
1 files changed, 107 insertions, 0 deletions
diff --git a/dev-lang/maude/files/maude-2.3.0-gcc43.patch b/dev-lang/maude/files/maude-2.3.0-gcc43.patch
new file mode 100644
index 000000000000..457359519b87
--- /dev/null
+++ b/dev-lang/maude/files/maude-2.3.0-gcc43.patch
@@ -0,0 +1,107 @@
+--- Maude-2.3/src/BuiltIn/stringOpSymbol.cc 2003-11-10 18:33:00.000000000 -0600
++++ Maude-2.4/src/BuiltIn/stringOpSymbol.cc 2008-09-11 19:03:36.000000000 -0600
+@@ -220,7 +220,9 @@ StringOpSymbol::eqRewrite(DagNode* subje
+ case CODE('f', 'l'):
+ {
+ bool error;
+- //double fl = stringToDouble(left.c_str(), error);
++#ifdef ROPE_C_STR_BROKEN
++ //
++ // This kudge doesn't seem to be need nowadays, but copy() doesn't work.
+ //
+ // This messing about is needed because Rope::c_str()
+ // fails in libstdc++-v3
+@@ -231,7 +233,9 @@ StringOpSymbol::eqRewrite(DagNode* subje
+ t[len] = '\0';
+ double fl = stringToDouble(t, error);
+ delete [] t;
+- //
++#else
++ double fl = stringToDouble(left.c_str(), error);
++#endif
+ if (error)
+ goto fail;
+ return floatSymbol->rewriteToFloat(subject, context, fl);
+@@ -282,6 +286,7 @@ StringOpSymbol::eqRewrite(DagNode* subje
+ break;
+ default:
+ CantHappen("bad string op");
++ r = false; // avoid compiler warning
+ }
+ Assert(trueTerm.getTerm() != 0 && falseTerm.getTerm() != 0,
+ "null true/false for relational op");
+@@ -358,6 +363,7 @@ StringOpSymbol::eqRewrite(DagNode* subje
+ break;
+ default:
+ CantHappen("bad string op");
++ r = 0; // avoid compiler warning
+ }
+ Assert(notFoundTerm.getTerm() != 0, "null notFound for find op");
+ if (r == NONE)
+@@ -591,6 +597,13 @@ StringOpSymbol::ropeToNumber(const crope
+ if (!isalnum(subject[j]))
+ return false;
+ }
++ //
++ // We have detected a fraction form.
++ //
++#ifdef ROPE_C_STR_BROKEN
++ //
++ // This kudge doesn't seem to be need nowadays, but copy() doesn't work.
++ //
+ char* t = new char[len]; // longer than needed but who cares
+ int dLen = len - (i + 1);
+ subject.copy(i + 1, dLen, t);
+@@ -609,20 +622,34 @@ StringOpSymbol::ropeToNumber(const crope
+ }
+ delete [] t;
+ return true;
++#else
++ return mpz_set_str(denominator.get_mpz_t(), subject.substr(i + 1).c_str(), base) == 0 &&
++ mpz_set_str(numerator.get_mpz_t(), subject.substr(0,i).c_str(), base) == 0;
++#endif
+ }
+ else
+ return false;
+ }
+ }
++ //
++ // We have a regular integer form.
++ //
++ denominator = 0;
++#ifdef ROPE_C_STR_BROKEN
++ //
++ // This kudge doesn't seem to be need nowadays, but copy() doesn't work.
++ //
+ char* t = new char[len + 1];
+ subject.copy(t);
+ t[len] = '\0';
+ if (mpz_set_str(numerator.get_mpz_t(), t, base) == 0)
+ {
+ delete [] t;
+- denominator = 0;
+ return true;
+ }
+ delete [] t;
+- return false;
++ return false;
++#else
++ return mpz_set_str(numerator.get_mpz_t(), subject.c_str(), base) == 0;
++#endif
+ }
+--- Maude-2.3/src/Utility/macros.hh 2007-01-11 21:13:21.000000000 -0600
++++ Maude-2.4/src/Utility/macros.hh 2008-09-04 13:52:55.000000000 -0600
+@@ -50,10 +50,10 @@
+ #if HAVE_CTYPE_H
+ #include <ctype.h>
+ #endif
+-#if HAVE_STRINGS_H
+-#include <strings.h>
+-#elif HAVE_STRING_H
++#if HAVE_STRING_H
+ #include <string.h>
++#elif HAVE_STRINGS_H
++#include <strings.h>
+ #endif
+ #if HAVE_UNISTD_H
+ #include <unistd.h> // needed by solaris