diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-13 13:06:34 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-13 13:06:34 (GMT) |
commit | 077504f676c966b4675f7140168f3a115a34af62 (patch) | |
tree | 236797c3b614da71424e4e076ffa00da0544dd19 /tools | |
parent | d0ff8f4a0d5b408ce2bf828775bff7c85fcb0b14 (diff) | |
parent | 6fdc83ae1490b9c80fdce1c5fc60af2ce84a08f0 (diff) | |
download | tcl-077504f676c966b4675f7140168f3a115a34af62.zip tcl-077504f676c966b4675f7140168f3a115a34af62.tar.gz tcl-077504f676c966b4675f7140168f3a115a34af62.tar.bz2 |
Merge 8.7
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/fix_tommath_h.tcl | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/tools/fix_tommath_h.tcl b/tools/fix_tommath_h.tcl deleted file mode 100755 index cee29fa..0000000 --- a/tools/fix_tommath_h.tcl +++ /dev/null @@ -1,103 +0,0 @@ -# fixtommath.tcl -- -# -# Changes to 'tommath.h' to make it conform with Tcl's linking -# conventions. -# -# Copyright (c) 2005 by Kevin B. Kenny. All rights reserved. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -#---------------------------------------------------------------------- - -set f [open [lindex $argv 0] r] -set data [read $f] -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 { - {#define BN_H_} { - puts $line - puts {} - puts "\#include \"tclTomMathDecls.h\"" - puts "\#ifndef MODULE_SCOPE" - 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 - puts "\#define MP_DIGIT_DECLARED" - puts "\#endif" - } - {typedef.*mp_word;} { - puts "\#ifndef MP_WORD_DECLARED" - puts $line - puts "\#define MP_WORD_DECLARED" - puts "\#endif" - } - {typedef struct} { - puts "\#ifndef MP_INT_DECLARED" - puts "\#define MP_INT_DECLARED" - puts "typedef struct mp_int mp_int;" - puts "\#endif" - puts "struct mp_int \{" - } - \}\ mp_int\; { - puts "\};" - } - {^(char|int|void)} { - puts "/*" - puts $line - set eat_semi 1 - set after_semi "*/" - } - {^extern (int|const)} { - puts "\#if defined(BUILD_tcl) || !defined(_WIN32)" - puts [regsub {^extern} $line "MODULE_SCOPE"] - set eat_semi 1 - set after_semi "\#endif" - } - {define heap macros} { - puts $line - puts "\#if 0 /* these are macros in tclTomMathDecls.h */" - set eat_endif 1 - } - {#include} { - # remove all includes - } - default { - puts $line - } - } - } else { - puts $line - } - if {$eat_semi} { - if {[regexp {; *$} $line]} { - puts $after_semi - set eat_semi 0 - } - } - if {$eat_endif} { - if {[regexp {^\#endif} $line]} { - puts "\#endif" - set eat_endif 0 - } - } -} |