[FFmpeg-cvslog] r14484 - in trunk/libavcodec: audioconvert.c audioconvert.h

Uoti Urpala uoti.urpala
Sat Aug 2 03:04:09 CEST 2008


On Sat, 2008-08-02 at 00:33 +0200, Michael Niedermayer wrote:
> The multple inclusion guards are in the header files not around
> the #includes
> 
> file.c
> #include <stdint.h>
> #include "avcodec.h"
> 
> avcodec.h
> #include <stdint.h>
> #include "avutil.h"
> 
> avutil.h
> #include <stdint.h>
> #include "common.h"
> 
> common.h
> #include <stdint.h>
> 
> stdint.h
> #ifndef BLAH
> #define BLAH
> [lots of stuff]
> #endif
> 
> will cause stdint.h to be parsed 4 times, the compiler has to, it has to find
> the correct #endif each time it hits stdint.h. There likely a more than 1
> #endif in it, it cant skip the #if /#else stuff in the middle

GCC would not parse it 4 times. It has some optimization that records
whether a file was completely wrapped inside a conditional controlled by
a macro, and skips parsing it again if the macro is defined. I made a
test file which #included avcodec.h a million times (61 MB file with
longish path in the #include) and GCC preprocessed it in under 2
seconds.





More information about the ffmpeg-cvslog mailing list