Mail Archives: djgpp/1997/02/09/19:34:29
Mark T Logan wrote:
>
> This way, a source file will never be compiled more than once.
> When it is compiled the compiler will define file_h, and then next
> time the file will be skipped because file_h is defined.
I use this trick all the time, and it does solve the problem of
including a header file more than once in the same source file.
However, it does not answer the original problem, which was multiple
_definitions_ of the same global variable if you include the header in
multiple source files. This is a big nono in C.
--
John M. Aldrich <fighteer AT cs DOT com>
* Anything that happens, happens.
* Anything that, in happening, causes something else to happen,
causes something else to happen.
* Anything that, in happening, causes itself to happen again, happens
again.
* It doesn't necessarily do it in chronological order, though.
--- Douglas Adams
- Raw text -