[vlc-devel] Macros & IDE
rem at videolan.org
Sat Dec 1 19:40:21 CET 2007
Le Sunday 25 November 2007 11:40:36 Jean-Paul Saman, vous avez écrit :
> Jean-Baptiste Kempf wrote:
> > On Sun, Nov 25, 2007, Guy Paddock wrote :
> >> Quick question: why does the VLC source use macros so much? I mean, I
> >> understand their use for ensuring unique function names in case
> >> modules are compiled-in or built separately, but IMO they seem to be
> >> overused. Personally, I like to avoid macros like the plague because
> >> they're not context-safe, but that's just me.
> > I am interested to know also why we use huge #defines when we could do
> > enum. Is this better code-size wise ? Faster ?
> Defines are resolved at compile time,
> while enums are runtime used.
Defines are resolved at pre-compilation time, while enum are resolved at
compilation time. In VLC, as in the overwhelming majority of cases, both
pre-compilation and compilation are done by the compiler, at build time.
More information about the vlc-devel