diff options
author | Kevin B Kenny <kennykb@acm.org> | 2007-02-14 17:59:21 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2007-02-14 17:59:21 (GMT) |
commit | d09c63e68f38457623b95d38022ea2ab019dc701 (patch) | |
tree | cfb3db92ff856ada3bf7375f563aabac7a999dc7 /tools/fix_tommath_h.tcl | |
parent | a6f84305e408210e5c738997584666d228771561 (diff) | |
download | tcl-d09c63e68f38457623b95d38022ea2ab019dc701.zip tcl-d09c63e68f38457623b95d38022ea2ab019dc701.tar.gz tcl-d09c63e68f38457623b95d38022ea2ab019dc701.tar.bz2 |
2007-02-13 Kevin Kenny <kennykb@acm.org>
* tools/fix_tommath_h.tcl: Further tweaking for the x86-64.
The change is to make 'mp_digit' be an 'unsigned int' on that
platform; since we're using only 32 bits of it, there's no
reason to make it a 64-bit 'unsigned long.'
* generic/tclTomMath.h: Regenerated.
Diffstat (limited to 'tools/fix_tommath_h.tcl')
-rwxr-xr-x | tools/fix_tommath_h.tcl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/fix_tommath_h.tcl b/tools/fix_tommath_h.tcl index 2ea3a02..9b2d258 100755 --- a/tools/fix_tommath_h.tcl +++ b/tools/fix_tommath_h.tcl @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: fix_tommath_h.tcl,v 1.5 2007/02/13 03:43:41 kennykb Exp $ +# RCS: @(#) $Id: fix_tommath_h.tcl,v 1.6 2007/02/14 17:59:22 kennykb Exp $ # #---------------------------------------------------------------------- @@ -18,6 +18,7 @@ close $f set eat_endif 0 set eat_semi 0 +set def_count 0 foreach line [split $data \n] { if { !$eat_semi && !$eat_endif } { switch -regexp -- $line { @@ -29,6 +30,18 @@ foreach line [split $data \n] { puts "\#define MODULE_SCOPE extern" puts "\#endif" } + {typedef\s+unsigned long\s+mp_digit;} { + # change the second 'typedef unsigned long mp + incr def_count + puts "\#ifndef MP_DIGIT_DECLARED" + if {$def_count == 2} { + puts [string map {long int} $line] + } else { + puts $line + } + puts "\#define MP_DIGIT_DECLARED" + puts "\#endif" + } {typedef.*mp_digit;} { puts "\#ifndef MP_DIGIT_DECLARED" puts $line |