3:
void maybe_foobar() {
if(defined('FOO_BAR_ENABLED')) really_foobar();
}
void really_foobar() {
}
, "" "", , , .
- , - " ", FOO_BAR_ENABLED , 2 (, , do_stuff_if_possible, foobar), foobar , -). " -", , 3.
1 , , .
[: 4, , , , :
void if_enabled(string str, function f) {
if (defined(str + '_ENABLED')) f();
}
:
if_enabled('FOO_BAR', foobar);
, , , , if_enabled.]