A Modest Extension to the C Preprocessor
Doug Gwyn <gwyn>
gwyn at brl-tgr.ARPA
Sun Aug 5 06:28:05 AEST 1984
#ifndef FOO_H_INCLUDED
#define FOO_H_INCLUDED
/* contents of "foo.h" */
#endif FOO_H_INCLUDED
is an excellent solution to the "problem", if it be one, that
does not penalize those that had no problem with this business
in the first place. This also solves the problem of making sure
that prerequisite files such as <sys/types.h> are included:
#ifndef SYSTYPES_H_INCLUDED
#include <sys/types.h>
#endif
/* stuff that uses <sys/types.h> typedefs */
Good work, Dave! I would, however, suggest shortening the
tag symbols a bit; probably "_H" could be safely removed.
More information about the Comp.lang.c
mailing list