Hi guys, I'm looking into the MINIX 3 source code and I often see things like
even though the file ansi.h was "guarded" withCode:#ifndef _ANSI_H #include <ansi.h> #endif
Isn't the effect of the first snippet equal to just?Code:#ifndef _ANSI_H #define _ANSI_H /* ansi.h contents */ #endif /* _ANSI_H */
Is that to avoid making the compiler open the file to see if it was already included, to protectCode:#include <ansi.h>
against not "guarded" files, or just bad style? I'm just curious.