delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/12/04:56:14

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: VBE Bankswitch in Pmode
Date: Wed, 11 Jun 1997 19:54:17 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 21
Message-ID: <339F0269.6F93@cs.com>
References: <339C40FA DOT 15F9 AT piper DOT hamline DOT edu> <R6MBNFAX7YnzEwtn AT foobar DOT co DOT uk>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp108.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Paul Shirley wrote:
> 
> The gnu make/cpp documentation claims that it can spot this sort of
> enclosure in include files and avoid loading them more than once.
> 
> Anyone know if it actually works? (I just assumed it would)

When I write my own header files and accidentally include them twice in
the same source file, I get all sorts of errors about multiply defined
constants and duplicate struct definitions and lots of other stuff. 
Using the #ifndef __header_h__/#define __header_h__/.../#endif trick
solves the problem perfectly.  Plus, it's the standard way to handle
it.  What else could you ask for?

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Be wary of strong drink.  It can    |
|       aka Fighteer I       | make you shoot at tax collectors--   |
|   mailto:fighteer AT cs DOT com   | and miss."                           |
| http://www.cs.com/fighteer |                 - Lazarus Long       |
---------------------------------------------------------------------

- Raw text -


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