Closed sevu closed 4 years ago
Another thing came to mind, instead of wrapping each marco in an #ifndef macro-name, eventually the [ressource] tag would cause the macros to be preprocessed just once – one could make the common things an ressource. https://wiki.wesnoth.org/ModificationWML#The_.5Bresource.5D_toplevel_tag That's just an guess and has not been tested
Either way, both – [loadressource] or #ifndef_ – assume that the macro definitions are for equals when used by the [modification] or [era] ( -> #18)
I believe that this is fixed now as of the latest update to ANLEra_worker_options_sp.cfg
No, these still exist when going into MP.
The reason are lines 13 and 58 in _main.cfg. Is line 58 needed?
The idea [resource] can be forgotten right away, macros and tags such as [resource] have nothing in common, as WML tags come into effect after the preprocessing is done. (At least if we want the macros somewhere else, one could otherwise import the [event] tag used for building with [load_resource].)
For the preprocessor it does not matter if the macro is defined in the [era] or [modification]s tag either, only the #ifdef MULTIPLAYER has relevance.
The order matters too, macros must be known before being used, otherwise an error is yield. (Or, it's also possible to use not-yet-defined macros inside macros, in this case preprocessing them is delayed.)
So… currently the macros for SP and MP have the same names, and do different things. Possible ways to get rid of the warning:
[In case it's relevant, to #undef an non-existant macro yields no warning]
There is the ANL era, and the ANL modification, both in the same add-on. Both source the same files.
The only thing which comes to mind is wrapping each macro into an #ifndef Or is there another way?