From d814fce94d6a1b83547a6cbbd1bc1bdbe3e013de Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sun, 28 May 2006 15:59:29 +0000 Subject: - In Fluid, declarations starting with the keyword 'typedef', 'class', or 'struct' are now treated correctly if inside a class (STR #1283) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5157 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 3 +++ fluid/Fl_Function_Type.cxx | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES b/CHANGES index 72b5ae595..ba3fd3a62 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ CHANGES IN FLTK 1.1.8 + - In Fluid, declarations starting with the keyword + 'typedef', 'class', or 'struct' are now treated + correctly if inside a class (STR #1283) - Tabs now show the correct tooltip (STR #1282) - Included fltk.spec in configure.in (STR #1274) - Fixed insufficiently invalidated cache diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index b8a98ebc4..1cf709dea 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -574,6 +574,17 @@ Fl_Decl_Type Fl_Decl_type; void Fl_Decl_Type::write_code1() { const char* c = name(); if (!c) return; + // handle a few keywords differently if inside a class + if (is_in_class() && ( + !strncmp(c,"class",5) && isspace(c[5]) + || !strncmp(c,"typedef",7) && isspace(c[7]) + || !strncmp(c,"FL_EXPORT",9) && isspace(c[9]) + || !strncmp(c,"struct",6) && isspace(c[6]) + ) ) { + write_public(public_); + write_h(" %s\n", c); + return; + } // handle putting #include, extern, using or typedef into decl: if (!isalpha(*c) && *c != '~' || !strncmp(c,"extern",6) && isspace(c[6]) -- cgit v1.2.3