Re: [scheme-reports-wg2] Threads and futures
Per Bothner 01 Apr 2022 23:20 UTC
On 4/1/22 16:03, Ray Dillinger wrote:
> In every header file, you'll see something like
>
> #ifndef LIB_H
> at the top and
>
> #endif
> at the bottom.
>
> But then the file is #include'd from a hundred places, and each of those
> places is #included from three others, and so on.....
>
> In order to prevent the system from having to read and parse the file
> again, leave the above just as it is but also go to all the places in
> your program where you say
>
> #include "lib.h"
>
> And say instead
>
> #ifndef LIB_H
> #include "lib.h"
> #endif
From my days as a young gcc hacker, I'm pretty sure gcc does
this optimization automatically. Or at least it used to.
Other quality compilers probably also do so.
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/