Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!ulysses!gsf From: gsf@ulysses.homer.nj.att.com (Glenn Fowler[drew]) Newsgroups: comp.lang.c Subject: Re: A solution to the multiple inclusion problem Summary: what is a file Message-ID: <12321@ulysses.homer.nj.att.com> Date: 25 Oct 89 04:10:13 GMT References: <14240@well.UUCP> <470005@gore.com> Organization: AT&T Bell Laboratories, Murray Hill Lines: 23 In article <470005@gore.com>, jacob@gore.com (Jacob Gore) writes: >> / comp.lang.c / mgordon@lotus.com (PCSD Mac) / Oct 24, 1989 / >> 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 > > Objective-C uses "#import" for just this. It's very convenient. (And > portable to all Objective-C implementations:-) the file equivalence relation may be hard to define, e.g., for unix, given ln x.h y.h will #require "y.h" include y.h following #include "x.h"? are "y.h" and "./y.h" the same file? are "y.h" and "/home/gsf/news/y.h" the same file? will #require "stdio.h" include stdio.h after #include ? the various #include "..." implementations further cloud the issue -- Glenn Fowler (201)-582-2195 AT&T Bell Laboratories, Murray Hill, NJ uucp: {att,decvax,ucbvax}!ulysses!gsf internet: gsf@ulysses.att.com