diff options
Diffstat (limited to 'Source/Modules/tcl8.cxx')
-rw-r--r-- | Source/Modules/tcl8.cxx | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/Source/Modules/tcl8.cxx b/Source/Modules/tcl8.cxx index 09bd266c3..015ac5e45 100644 --- a/Source/Modules/tcl8.cxx +++ b/Source/Modules/tcl8.cxx @@ -46,6 +46,7 @@ static int nosafe = 0; static File *f_header = 0; static File *f_wrappers = 0; static File *f_init = 0; +static File *f_begin = 0; static File *f_runtime = 0; @@ -121,6 +122,7 @@ public: } Preprocessor_define("SWIGTCL 1", 0); + // SWIGTCL8 is deprecated, and no longer documented. Preprocessor_define("SWIGTCL8 1", 0); SWIG_typemap_lang("tcl8"); SWIG_config_file("tcl8.swg"); @@ -136,11 +138,12 @@ public: /* Initialize all of the output files */ String *outfile = Getattr(n, "outfile"); - f_runtime = NewFile(outfile, "w"); - if (!f_runtime) { + f_begin = NewFile(outfile, "w", SWIG_output_files()); + if (!f_begin) { FileErrorDisplay(outfile); SWIG_exit(EXIT_FAILURE); } + f_runtime = NewString(""); f_init = NewString(""); f_header = NewString(""); f_wrappers = NewString(""); @@ -148,6 +151,7 @@ public: /* Register file targets with the SWIG file handler */ Swig_register_filebyname("header", f_header); Swig_register_filebyname("wrapper", f_wrappers); + Swig_register_filebyname("begin", f_begin); Swig_register_filebyname("runtime", f_runtime); Swig_register_filebyname("init", f_init); @@ -158,7 +162,11 @@ public: methods_tab = NewString(""); const_tab = NewString(""); - Swig_banner(f_runtime); + Swig_banner(f_begin); + + Printf(f_runtime, "\n"); + Printf(f_runtime, "#define SWIGTCL\n"); + Printf(f_runtime, "\n"); /* Set the module name, namespace, and prefix */ @@ -177,7 +185,7 @@ public: Insert(module, 0, "_"); - if ((f_shadow = NewFile(filen, "w")) == 0) { + if ((f_shadow = NewFile(filen, "w", SWIG_output_files())) == 0) { FileErrorDisplay(filen); SWIG_exit(EXIT_FAILURE); } @@ -186,10 +194,7 @@ public: Swig_register_filebyname("shadow", f_shadow); Swig_register_filebyname("itcl", f_shadow); - Printf(f_shadow, "# This file was automatically generated by SWIG (http://www.swig.org).\n"); - Printf(f_shadow, "# Version %s\n", Swig_package_version()); - Printf(f_shadow, "#\n"); - Printf(f_shadow, "# Don't modify this file, modify the SWIG interface instead.\n"); + Swig_banner_target_lang(f_shadow, "#"); Printv(f_shadow, "\npackage require Itcl\n\n", NIL); Delete(filen); @@ -244,12 +249,15 @@ public: } /* Close all of the files */ - Printv(f_runtime, f_header, f_wrappers, NIL); - Wrapper_pretty_print(f_init, f_runtime); + Dump(f_runtime, f_begin); + Printv(f_begin, f_header, f_wrappers, NIL); + Wrapper_pretty_print(f_init, f_begin); Delete(f_header); Delete(f_wrappers); Delete(f_init); - Close(f_runtime); + Close(f_begin); + Delete(f_runtime); + Delete(f_begin); return SWIG_OK; } |