Mail Archives: djgpp/2002/07/28/03:06:35
From: | "Patrick Chen" <pck66 AT pd DOT jaring DOT my>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | conditional compilation for typedef
|
Date: | Sun, 28 Jul 2002 14:57:38 +0800
|
Organization: | Unconfigured
|
Lines: | 33
|
Message-ID: | <ai04lk$7i$1@news5.jaring.my>
|
NNTP-Posting-Host: | j82.sgw48.jaring.my
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 6.00.2600.0000
|
X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2600.0000
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
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;
Compilation-Build all, incurred multiple definition error.
Removing a copy from one of the header files above can solve the problem.
But it cause inconvenience of having to remove typedef everytime whenever a
new library is added to the main program compilation list. And it may cause
'no typedef' when another main program try to use the lib associated with
the h file, in which the typedef was removed by an earlier program.
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?
If not, please suggest a better style to declare typedef for developing
program using multiple libraries.
Thanks.
Patrick
- Raw text -