[Scummvm-devel] ScummVM 0.12.0: Release status -- 2008-07-13
Max Horn
max at quendi.de
Mon Jul 14 13:52:57 CEST 2008
Am 14.07.2008 um 12:55 schrieb Marcus Comstedt:
>
> Max Horn <max at quendi.de> writes:
>
>> Anyway, in the very worst case, we can solve any problems with
>> PLUGIN_ENABLED_STATIC by replacing the elegant
>> #if PLUGIN_ENABLED_STATIC(AGI)
>> by the repetitive but definitely portable
>> #if defined(ENABLE_AGI) && !((ENABLE_AGI == DYNAMIC_PLUGIN) &&
>> defined(DYNAMIC_MODULES))
>
> Actually, the defined() should not be needed; it is allowed to use
> an undefined preprocessor symbol as a numeric expression, in which
> case it evaluates to 0. So as long as STATIC_PLUGIN and
> DYNAMIC_PLUGIN are defined to a non-zero numeric values,
Interesting suggestions. However it causes GCC to produce warnings,
like this one:
base/plugins.cpp:30:5: warning: "FOOBAR" is not defined
So unless there is a -Wno- option to explicitly I'd rather avoid this
if possible, we try to stay warning free, when possible. Or . I guess
we'll just have to brace and take the approach of replacing that
clever macro with its expansion, for the sake of portability...
BTW, in the engines themselves, we could replace
#if PLUGIN_ENABLED_DYNAMIC(AGI)
simply by
#if defined(DYNAMIC_MODULES) && (ENABLE_AGI == DYNAMIC_PLUGIN)
since that code is (should be?) only compiled if the plugin is enabled
anyway.
Cheers,
Max
More information about the Scummvm-devel
mailing list