[Python]
Split docstrings into separate string literals at each newline when generating C/C++ wrapper code (the C/C++ compiler will just combine the back into a single string literal). This avoids MSVC complaining that the strings are too long (problem reported by Bo Peng on the mailing list). git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9841 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
af2d15d2a5
commit
f08000de17
2 changed files with 12 additions and 4 deletions
|
|
@ -1,6 +1,14 @@
|
||||||
Version 1.3.32 (in progress)
|
Version 1.3.32 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
05/29/2007: olly
|
||||||
|
[Python]
|
||||||
|
Split docstrings into separate string literals at each newline when
|
||||||
|
generating C/C++ wrapper code (the C/C++ compiler will just combine
|
||||||
|
the back into a single string literal). This avoids MSVC
|
||||||
|
complaining that the strings are too long (problem reported by
|
||||||
|
Bo Peng on the mailing list).
|
||||||
|
|
||||||
05/28/2007: olly
|
05/28/2007: olly
|
||||||
[Python]
|
[Python]
|
||||||
Escape backslashes in docstrings.
|
Escape backslashes in docstrings.
|
||||||
|
|
|
||||||
|
|
@ -1420,8 +1420,8 @@ public:
|
||||||
if (have_docstring(n)) {
|
if (have_docstring(n)) {
|
||||||
String *ds = docstring(n, AUTODOC_FUNC, "", false);
|
String *ds = docstring(n, AUTODOC_FUNC, "", false);
|
||||||
Replaceall(ds, "\\", "\\\\");
|
Replaceall(ds, "\\", "\\\\");
|
||||||
Replaceall(ds, "\n", "\\n");
|
Replaceall(ds, "\"", "\\\"");
|
||||||
Replaceall(ds, "\"", "\\\"");
|
Replaceall(ds, "\n", "\\n\"\n\t\t\"");
|
||||||
Printf(methods, "(char *)\"%s\\nswig_ptr: %s\"", ds, Getattr(n, "feature:callback:name"));
|
Printf(methods, "(char *)\"%s\\nswig_ptr: %s\"", ds, Getattr(n, "feature:callback:name"));
|
||||||
} else {
|
} else {
|
||||||
Printf(methods, "(char *)\"swig_ptr: %s\"", Getattr(n, "feature:callback:name"));
|
Printf(methods, "(char *)\"swig_ptr: %s\"", Getattr(n, "feature:callback:name"));
|
||||||
|
|
@ -1429,8 +1429,8 @@ public:
|
||||||
} else if (have_docstring(n)) {
|
} else if (have_docstring(n)) {
|
||||||
String *ds = docstring(n, AUTODOC_FUNC, "", false);
|
String *ds = docstring(n, AUTODOC_FUNC, "", false);
|
||||||
Replaceall(ds, "\\", "\\\\");
|
Replaceall(ds, "\\", "\\\\");
|
||||||
Replaceall(ds, "\n", "\\n");
|
|
||||||
Replaceall(ds, "\"", "\\\"");
|
Replaceall(ds, "\"", "\\\"");
|
||||||
|
Replaceall(ds, "\n", "\\n\"\n\t\t\"");
|
||||||
Printf(methods, "(char *)\"%s\"", ds);
|
Printf(methods, "(char *)\"%s\"", ds);
|
||||||
} else {
|
} else {
|
||||||
Append(methods, "NULL");
|
Append(methods, "NULL");
|
||||||
|
|
@ -2445,7 +2445,7 @@ public:
|
||||||
It should be possible to rewrite it using a more elegant way,
|
It should be possible to rewrite it using a more elegant way,
|
||||||
like copying the Java approach for the 'override' array.
|
like copying the Java approach for the 'override' array.
|
||||||
|
|
||||||
But for know, this seems to be the least intrusive way.
|
But for now, this seems to be the least intrusive way.
|
||||||
*/
|
*/
|
||||||
Printf(f_directors_h, "\n\n");
|
Printf(f_directors_h, "\n\n");
|
||||||
Printf(f_directors_h, "/* Internal Director utilities */\n");
|
Printf(f_directors_h, "/* Internal Director utilities */\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue