Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!samsung!ginosko!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: A solution to the multiple inclusion problem Message-ID: <11422@smoke.BRL.MIL> Date: 27 Oct 89 17:35:39 GMT References: <946@friar-taac.UUCP> <8956@goofy.megatest.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 In article <8956@goofy.megatest.UUCP> djones@megatest.UUCP (Dave Jones) writes: -))In article <14240@well.UUCP) nagle@well.UUCP (John Nagle) writes: -))) #ifndef XXX -))) #define XXX -))) ...content... -))) #endif -... do it this way... - #ifndef XXX - ...content... - #define XXX - #endif I recommend just the opposite. If the body of the header #includes itself recursively (which is a very useful thing to permit), then the idempotency lock doesn't work right unless you set it before the nested #inclusion.