diff --git a/CHANGES.current b/CHANGES.current index 2d300d2d4..65a5d45e9 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,14 @@ 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 [Python] Escape backslashes in docstrings. diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index cfbd793d1..06d740afd 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -1420,8 +1420,8 @@ public: if (have_docstring(n)) { String *ds = docstring(n, AUTODOC_FUNC, "", false); 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")); } else { Printf(methods, "(char *)\"swig_ptr: %s\"", Getattr(n, "feature:callback:name")); @@ -1429,8 +1429,8 @@ public: } else if (have_docstring(n)) { String *ds = docstring(n, AUTODOC_FUNC, "", false); Replaceall(ds, "\\", "\\\\"); - Replaceall(ds, "\n", "\\n"); Replaceall(ds, "\"", "\\\""); + Replaceall(ds, "\n", "\\n\"\n\t\t\""); Printf(methods, "(char *)\"%s\"", ds); } else { Append(methods, "NULL"); @@ -2445,7 +2445,7 @@ public: It should be possible to rewrite it using a more elegant way, 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, "/* Internal Director utilities */\n");