www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/09/19:34:29

Message-ID: <32FE9632.64CB@cs.com>
Date: Sun, 09 Feb 1997 19:29:54 -0800
From: "John M. Aldrich" <fighteer AT cs DOT com>
Reply-To: fighteer AT cs DOT com
Organization: Two pounds of chaos and a pinch of salt
MIME-Version: 1.0
To: Mark T Logan <fwec AT juno DOT com>
CC: djgpp AT delorie DOT com
Subject: Re: Help With Include Files.....PLEASE!
References: <32FC8E53 DOT 77A4 AT praxis DOT net>
<32FD0263 DOT 4DC1 AT cs DOT com> <19970209 DOT 132720 DOT 7543 DOT 1 DOT fwec AT juno DOT com>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019