diff options
| author | Matthias Melcher <github@matthiasm.com> | 2022-02-13 00:54:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-13 00:54:44 +0100 |
| commit | c9b44064d205a16790eed7e91ba81365b057c8f1 (patch) | |
| tree | 2e2cac06ac22a6973cb143d440a398bd1a44c78c /fluid/Fl_Function_Type.cxx | |
| parent | 52bfbbc2fac6dd7555a777d38c4f8d8227b41008 (diff) | |
Fluid: adding feature: Functions can also be "local". (#390)
Before, Functions could only be "static" (keyword static is added)
or "global" (prototype is added). This is harmful if the function or
method was declared elsewhere. "local" solves that.
Diffstat (limited to 'fluid/Fl_Function_Type.cxx')
| -rw-r--r-- | fluid/Fl_Function_Type.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index f51570d92..8b15316cc 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -253,7 +253,7 @@ void Fl_Function_Type::open() { f_public_choice->hide(); f_c_button->hide(); } else { - f_public_choice->value(public_>0); + f_public_choice->value(public_); f_public_choice->show(); f_public_member_choice->hide(); f_c_button->show(); @@ -441,11 +441,13 @@ void Fl_Function_Type::write_code1() { } else { if (havechildren) write_comment_c(); - if (public_) { + if (public_==1) { if (cdecl_) write_h("extern \"C\" { %s%s %s; }\n", rtype, star, name()); else write_h("%s%s %s;\n", rtype, star, name()); + } else if (public_==2) { + // write neither the prototype nor static, the function may be declared elsewhere } else { if (havechildren) write_c("static "); |
