Newsgroups: comp.lang.c++ Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: #once cpp directive implemented! Message-ID: <1989Mar21.215138.6881@utzoo.uucp> Organization: U of Toronto Zoology References: <124@riunite.ACA.MCC.COM> Date: Tue, 21 Mar 89 21:51:38 GMT In article <124@riunite.ACA.MCC.COM> rfg@riunite.UUCP (Ron Guilmette) writes: >... patches for the the GNU C >preprocessor (version 1.34) which implement the new #once >directive... >The semantics of the #once directive are simple. The #once >directive causes any file it appears in to be included no more >than one time during any given individual compilation... Was it really necessary to invent a new directive for this? The existing construct: #ifndef gorble_h #define gorble_h 1 ... #endif suffices. Patches to the compiler to recognize *this* construct in an include file, and optimize out future references to that file, would do the same job and be 100% compatible with both existing practice and existing standardization efforts. #once is neither. -- Welcome to Mars! Your | Henry Spencer at U of Toronto Zoology passport and visa, comrade? | uunet!attcan!utzoo!henry henry@zoo.toronto.edu