summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2006-05-28 15:59:29 +0000
committerMatthias Melcher <fltk@matthiasm.com>2006-05-28 15:59:29 +0000
commitd814fce94d6a1b83547a6cbbd1bc1bdbe3e013de (patch)
treef562747005cf3004f0ef87df2a697f07a0aa3fef
parent84ac69cd2776303a5fa254f094e89fda4b9696b5 (diff)
- 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
-rw-r--r--CHANGES3
-rw-r--r--fluid/Fl_Function_Type.cxx11
2 files changed, 14 insertions, 0 deletions
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])