fix for LP64 and gcc4.

still passes all regression tests.
bump pkgname + shared lib major, since we substitute an unsigned long to
an unsigned int in internal data structures.
This commit is contained in:
espie 2010-06-07 13:47:44 +00:00
parent 5c868c2c98
commit a31ee81cbe
5 changed files with 167 additions and 11 deletions

View File

@ -1,9 +1,10 @@
# $Id: Makefile,v 1.6 2009/10/12 16:23:05 pirofti Exp $
# $Id: Makefile,v 1.7 2010/06/07 13:47:44 espie Exp $
COMMENT= GiNaC is Not a Computer Algebra System (CAS)
DISTNAME= ginac-1.5.3
SHARED_LIBS += ginac 1.5 # 0.3
PKGNAME= ${DISTNAME}p0
SHARED_LIBS += ginac 2.0 # 0.3
CATEGORIES= math
HOMEPAGE= http://www.ginac.de/

View File

@ -1,6 +1,6 @@
--- configure.orig Wed Feb 25 15:02:36 2009
+++ configure Tue Mar 10 16:12:26 2009
@@ -11745,7 +11745,7 @@ if test "${ac_cv_lib_dl_dlopen+set}" = set; then
--- configure.orig Thu Jul 30 19:06:02 2009
+++ configure Mon Jun 7 03:59:36 2010
@@ -11835,7 +11835,7 @@ if test "${ac_cv_lib_dl_dlopen+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@ -9,7 +9,7 @@
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -12067,7 +12067,7 @@ if test "${ac_cv_lib_dl_dlopen+set}" = set; then
@@ -12157,7 +12157,7 @@ if test "${ac_cv_lib_dl_dlopen+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@ -18,7 +18,7 @@
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -12203,7 +12203,7 @@ if test "${ac_cv_lib_dld_dld_link+set}" = set; then
@@ -12293,7 +12293,7 @@ if test "${ac_cv_lib_dld_dld_link+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-ginac_Makefile_in,v 1.2 2009/03/17 11:53:01 pirofti Exp $
--- ginac/Makefile.in.orig Wed Feb 25 15:02:39 2009
+++ ginac/Makefile.in Tue Mar 10 16:12:26 2009
@@ -299,7 +299,7 @@ polynomial/primpart_content.cpp \
$OpenBSD: patch-ginac_Makefile_in,v 1.3 2010/06/07 13:47:44 espie Exp $
--- ginac/Makefile.in.orig Thu Jul 30 19:06:05 2009
+++ ginac/Makefile.in Mon Jun 7 03:59:36 2010
@@ -316,7 +316,7 @@ polynomial/primpart_content.cpp \
polynomial/smod_helpers.h \
polynomial/debug.h

View File

@ -0,0 +1,143 @@
$OpenBSD: patch-ginac_function_pl,v 1.1 2010/06/07 13:47:44 espie Exp $
--- ginac/function.pl.orig Wed Jul 15 06:29:52 2009
+++ ginac/function.pl Mon Jun 7 10:48:59 2010
@@ -59,7 +59,7 @@ sub generate {
$declare_function_macro = generate(
<<'END_OF_DECLARE_FUNCTION_MACRO','typename T${N}','const T${N} & p${N}','GiNaC::ex(p${N})');
#define DECLARE_FUNCTION_${N}P(NAME) \\
-class NAME##_SERIAL { public: static unsigned serial; }; \\
+class NAME##_SERIAL { public: static serial_t serial; }; \\
const unsigned NAME##_NPARAMS = ${N}; \\
template<${SEQ1}> const GiNaC::function NAME(${SEQ2}) { \\
return GiNaC::function(NAME##_SERIAL::serial, ${SEQ3}); \\
@@ -130,12 +130,12 @@ $print_func_interface=generate(
END_OF_PRINT_FUNC_INTERFACE
$constructors_interface=generate(
-' function(unsigned ser, ${SEQ1});'."\n",
+' function(serial_t ser, ${SEQ1});'."\n",
'const ex & param${N}','','');
$constructors_implementation=generate(
<<'END_OF_CONSTRUCTORS_IMPLEMENTATION','const ex & param${N}','param${N}','');
-function::function(unsigned ser, ${SEQ1})
+function::function(serial_t ser, ${SEQ1})
: exprseq(${SEQ2}), serial(ser)
{
}
@@ -318,13 +318,14 @@ $interface=<<END_OF_INTERFACE;
#include <algorithm>
#include <string>
#include <vector>
+typedef unsigned long serial_t;
// the following lines have been generated for max. ${maxargs} parameters
$declare_function_macro
// end of generated lines
#define REGISTER_FUNCTION(NAME,OPT) \\
-unsigned NAME##_SERIAL::serial = \\
+serial_t NAME##_SERIAL::serial = \\
GiNaC::function::register_new(GiNaC::function_options(#NAME, NAME##_NPARAMS).OPT);
namespace GiNaC {
@@ -490,13 +491,13 @@ class function : public exprseq
// other constructors
public:
- function(unsigned ser);
+ function(serial_t ser);
// the following lines have been generated for max. ${maxargs} parameters
$constructors_interface
// end of generated lines
- function(unsigned ser, const exprseq & es);
- function(unsigned ser, const exvector & v, bool discardable = false);
- function(unsigned ser, std::auto_ptr<exvector> vp);
+ function(serial_t ser, const exprseq & es);
+ function(serial_t ser, const exvector & v, bool discardable = false);
+ function(serial_t ser, std::auto_ptr<exvector> vp);
// functions overriding virtual functions from base classes
public:
@@ -533,16 +534,16 @@ $constructors_interface (protected)
void store_remember_table(ex const & result) const;
public:
ex power(const ex & exp) const;
- static unsigned register_new(function_options const & opt);
- static unsigned current_serial;
- static unsigned find_function(const std::string &name, unsigned nparams);
- unsigned get_serial() const {return serial;}
+ static serial_t register_new(function_options const & opt);
+ static serial_t current_serial;
+ static serial_t find_function(const std::string &name, unsigned nparams);
+ serial_t get_serial() const {return serial;}
std::string get_name() const;
// member variables
protected:
- unsigned serial;
+ serial_t serial;
};
GINAC_DECLARE_UNARCHIVER(function);
@@ -803,7 +804,7 @@ void function_options::set_print_func(unsigned id, pri
}
/** This can be used as a hook for external applications. */
-unsigned function::current_serial = 0;
+serial_t function::current_serial = 0;
GINAC_IMPLEMENT_REGISTERED_CLASS(function, exprseq)
@@ -824,7 +825,7 @@ function::function() : serial(0)
// public
-function::function(unsigned ser) : serial(ser)
+function::function(serial_t ser) : serial(ser)
{
}
@@ -832,7 +833,7 @@ function::function(unsigned ser) : serial(ser)
$constructors_implementation
// end of generated lines
-function::function(unsigned ser, const exprseq & es) : exprseq(es), serial(ser)
+function::function(serial_t ser, const exprseq & es) : exprseq(es), serial(ser)
{
// Force re-evaluation even if the exprseq was already evaluated
@@ -840,12 +841,12 @@ function::function(unsigned ser, const exprseq & es) :
clearflag(status_flags::evaluated);
}
-function::function(unsigned ser, const exvector & v, bool discardable)
+function::function(serial_t ser, const exvector & v, bool discardable)
: exprseq(v,discardable), serial(ser)
{
}
-function::function(unsigned ser, std::auto_ptr<exvector> vp)
+function::function(serial_t ser, std::auto_ptr<exvector> vp)
: exprseq(vp), serial(ser)
{
}
@@ -1343,7 +1344,7 @@ void function::store_remember_table(ex const & result)
// public
-unsigned function::register_new(function_options const & opt)
+serial_t function::register_new(function_options const & opt)
{
size_t same_name = 0;
for (size_t i=0; i<registered_functions().size(); ++i) {
@@ -1372,7 +1373,7 @@ unsigned function::register_new(function_options const
/** Find serial number of function by name and number of parameters.
* Throws exception if function was not found. */
-unsigned function::find_function(const std::string &name, unsigned nparams)
+serial_t function::find_function(const std::string &name, unsigned nparams)
{
std::vector<function_options>::const_iterator i = function::registered_functions().begin(), end = function::registered_functions().end();
unsigned serial = 0;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-ginac_parser_parser_cpp,v 1.1 2010/06/07 13:47:44 espie Exp $
--- ginac/parser/parser.cpp.orig Mon Jun 7 09:40:21 2010
+++ ginac/parser/parser.cpp Mon Jun 7 09:50:26 2010
@@ -66,7 +66,7 @@ ex parser::parse_identifier_expr()
Parse_error_("no function \"" << name << "\" with " <<
args.size() << " arguments");
}
- ex ret = GiNaC::function((unsigned)reader->second, args);
+ ex ret = GiNaC::function((serial_t)reader->second, args);
return ret;
}