Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!brutus.cs.uiuc.edu!flute!grunwald From: grunwald@flute.cs.uiuc.edu (Dirk Grunwald) Newsgroups: gnu.gcc Subject: Re: Is "#pragma once" necessary? Message-ID: Date: 25 Jul 89 17:51:01 GMT References: Sender: news@brutus.cs.uiuc.edu Reply-To: grunwald@flute.cs.uiuc.edu Organization: University of Illinois, Urbana-Champaign Lines: 29 In-reply-to: dld@F.GP.CS.CMU.EDU's message of 25 Jul 89 17:01:01 GMT hacking cpp to recognize #ifndef sounds like even more of a problem; people have different conventions on where they place the #ifndef, the #define and so on. Rather than play tricks like this, I think that having #requires and #provides would be a lot cleaner, albeit less portable. One could have syntax akin to include, e.g: bar.c: #require ... foo.h: #provide where the #provides is really redundant. You could also play more elaborate games with such a mechanism, e.g., allow arbitrary strings to be required and provided: bar.c: #require "valid machine description" which would be a cleaner way of barfing on bad configurations than; #ifndef VALID_MACHINE_DESCRIPTION You don't have a valid description! #endif Since gnu CPP can be easily distributed, portability isn't much of an issue -- if someone uses your library, tell them to also use gnu CPP. -- Dirk Grunwald -- Univ. of Illinois (grunwald@flute.cs.uiuc.edu)