doc: remove lots of warning in doc generation
Some simple stuff, but more important change the way the macro expansion is
done. To allow correct expansion of doc, some macros are exapanded by the
doxygen parser before the doc is generated.
See the EXPAND_AS_DEFINED, and PREDEFINED values in the doxygen config file.