summaryrefslogtreecommitdiff
path: root/fluid/Fl_Widget_Type.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-12-17 01:02:16 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-12-17 01:02:16 +0000
commit12e9d23bc39ed6edb88af89723449f39ff088fad (patch)
treee8b18602eb509c8e81788f1aaba6581cce6610c6 /fluid/Fl_Widget_Type.cxx
parentd7ee0df84ca8d0e1694dbc1d700b274b69fa64c5 (diff)
Don't append a semicolon to callback function code when the last line
is blank or is a preprocessor directive. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1856 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Widget_Type.cxx')
-rw-r--r--fluid/Fl_Widget_Type.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx
index 842fdc3cf..c57982c7f 100644
--- a/fluid/Fl_Widget_Type.cxx
+++ b/fluid/Fl_Widget_Type.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.8 2001/11/25 16:38:11 easysw Exp $"
+// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.9 2001/12/17 01:02:16 easysw Exp $"
//
// Widget type code for the Fast Light Tool Kit (FLTK).
//
@@ -1423,7 +1423,14 @@ void Fl_Widget_Type::write_static() {
write_c(", %s", ut);
if (use_v) write_c(" v");
write_c(") {\n %s", callback());
- if (*(d-1) != ';') write_c(";");
+ if (*(d-1) != ';') {
+ const char *p = strrchr(callback(), '\n');
+ if (p) p ++;
+ else p = callback();
+ // Only add trailing semicolon if the last line is not a preprocessor
+ // statement...
+ if (*p != '#' && *p) write_c(";");
+ }
write_c("\n}\n");
if (k) {
write_c("void %s::%s(%s* o, %s v) {\n", k, cn, t, ut);
@@ -1963,5 +1970,5 @@ int Fl_Widget_Type::read_fdesign(const char* name, const char* value) {
}
//
-// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.8 2001/11/25 16:38:11 easysw Exp $".
+// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.9 2001/12/17 01:02:16 easysw Exp $".
//