To: djgpp AT delorie DOT com Subject: Re: Why two identical typedef are considered an error in DJGPP? Message-ID: <19970114.151132.2183.2.chambersb@juno.com> References: <01IE7MKQWZ2Q003361 AT cc DOT uab DOT es> From: chambersb AT juno DOT com (Benjamin D Chambers) Date: Tue, 14 Jan 1997 18:11:58 EST On Tue, 14 Jan 1997 17:41:10 +0000 "x DOT pons AT cc DOT uab DOT es" writes: >Dear programmers, > >If I write something like this in a xxx.h file > > typedef unsigned char BYTE; > >and I have *THE SAME* typedef in some other yyy.h file, >both included in the same .c file, the DJGPP compiler complains >that: > > file xxx.h line n redefinition of `BYTE' > file yyy.h line m `BYTE' previously declared here > >Is there some way to avoid this error, which is not even a warning >in other compilers (provided, of course, that both definitions are >identical)? Sure. Use: #ifndef BYTE typedef unsigned char BYTE; #endif > >Thanks in advance, > No problem. >XP > ...Chambers