Mail Archives: djgpp/2002/07/28/09:56:34
Patrick Chen <pck66 AT pd DOT jaring DOT my> wrote:
> Use Rhide: C, djgpp.
> Dear All,
> The files are as follows:
> mouse3.c - main file
> lmouse3_video.c - implementation file-video functions
> lmouse3_video.h- header file -video functions
> lmouse3_bitmap.c - implementation file- bitmap functions
> lmouse3_bitmap.h - header file - bitmap functions
> lmouse3_video.h contains:
> typedef unsigned short word;
> lmouse3_bitmap.h contains:
> typedef unsigned short word;
Bad planning here. Move common typedefs like this into a separate header file.
And have the usual multiple-inclusion guards around that (and all other header files):
#ifndef LMOUSE3_TYPES_H
#define LMOUSE3_TYPES_H
/* ... contents here */
#endif /* LMOUSE3_TYPES_H */
> Is there a condition compilation statement that can be put to every
> header file, so that whenever the first one is found by the pre-processor
> the other one will be ignored?
No, because the preprocessor doesn't even know what a typedef is, so it can't
know whether it alreaady came by one of a given name, yet.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -