Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!wuarchive!wugate!uunet!lotus!mgordon From: mgordon@lotus.com (PCSD Mac) Newsgroups: comp.lang.c Subject: Re: A solution to the multiple inclusion problem Keywords: #include c c++ Message-ID: <1989Oct24.153611.12168@lotus.com> Date: 24 Oct 89 15:36:11 GMT References: <14240@well.UUCP> <15316@bloom-beacon.MIT.EDU> Reply-To: mgordon@lotus.UUCP (PCSD Mac) Distribution: comp Organization: Lotus Development Corp. Lines: 11 How about a new preprocessor directive that means "include this file only if it hasn't already been included", say "#require"? The "preprocessor" would simply keep a table of files that have already been included and use it to avoid including the same #required file more than once. There will always be files you really do want to #include multiple times, so you can't change the meaning of #include. I believe that would do the trick, and it wouldn't break any existing programs. If you use this construct though, you can't go back to compilers that don't support it.