Eliminate 2 redundant copies of swig banner

We had a banner for C, a banner for target languages (parameterised
to allow the comment sequence to be specified) and a special banner
for XML files in scilab.cxx.

The XML variant was only needed because the standard banner contains
`--` for a hyphen, so we now use ` - ` for that instead.

The C banner now calls Swig_banner_target_lang() with a suitable
comment sequence to print the actual banner text.
This commit is contained in:
Olly Betts 2022-10-06 14:33:15 +13:00
parent 5fb5c5f74d
commit 80d05a1a6c
2 changed files with 4 additions and 15 deletions

View File

@ -957,11 +957,7 @@ public:
gatewayXML = NewString("");
Printf(gatewayXML, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");
Printf(gatewayXML, "<!--\n");
Printf(gatewayXML, "This file was automatically generated by SWIG (https://www.swig.org).\n");
Printf(gatewayXML, "Version %s\n", Swig_package_version());
Printf(gatewayXML, "\n");
Printf(gatewayXML, "Do not make changes to this file unless you know what you are doing - modify\n");
Printf(gatewayXML, "the SWIG interface file instead.\n");
Swig_banner_target_lang(gatewayXML, "");
Printf(gatewayXML, "-->\n");
Printf(gatewayXML, "<GATEWAY name=\"%s\">\n", gatewayName);

View File

@ -69,15 +69,8 @@ const char *Swig_package_version(void) {
* ----------------------------------------------------------------------------- */
void Swig_banner(File *f) {
Printf(f, "/* ----------------------------------------------------------------------------\n\
* This file was automatically generated by SWIG (https://www.swig.org).\n\
* Version %s\n\
*\n\
* This file is not intended to be easily readable and contains a number of\n\
* coding conventions designed to improve portability and efficiency. Do not make\n\
* changes to this file unless you know what you are doing--modify the SWIG\n\
* interface file instead.\n", Swig_package_version());
/* String too long for ISO compliance */
Printf(f, "/* ----------------------------------------------------------------------------\n");
Swig_banner_target_lang(f, " *");
Printf(f, " * ----------------------------------------------------------------------------- */\n");
}
@ -92,7 +85,7 @@ void Swig_banner_target_lang(File *f, const_String_or_char_ptr commentchar) {
Printf(f, "%s This file was automatically generated by SWIG (https://www.swig.org).\n", commentchar);
Printf(f, "%s Version %s\n", commentchar, Swig_package_version());
Printf(f, "%s\n", commentchar);
Printf(f, "%s Do not make changes to this file unless you know what you are doing--modify\n", commentchar);
Printf(f, "%s Do not make changes to this file unless you know what you are doing - modify\n", commentchar);
Printf(f, "%s the SWIG interface file instead.\n", commentchar);
}