From: Dave Pearson Newsgroups: comp.os.msdos.djgpp Subject: Re: Why two identical typedef are considered an error in DJGPP? Date: Sat, 18 Jan 1997 01:01:22 GMT Organization: Hagbard's World (A Private Internet Host) Lines: 46 Sender: usenet AT hagbard DOT demon DOT co DOT uk Message-ID: References: <01IE7MKQWZ2Q003361 AT cc DOT uab DOT es> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Paul Shirley wrote: > >if not defined "BYTEdefined" > >define "BYTEdefined" > >declare BYTE > >end if > > #ifndef BYTE > typedef unsigned char BYTE; > #endif > > ...is what I usually do. And it works for you? In that case, this should work: ---------------------------------------------------------------------- #ifndef BYTE typedef unsigned char BYTE; #endif #ifndef BYTE typedef unsigned char BYTE; #endif int main( void ) { return( 0 ); } ---------------------------------------------------------------------- Compiler output (GCC on Linux): ---------------------------------------------------------------------- davep:~/temp$gcc foo.c foo.c:6: redefinition of `BYTE' foo.c:2: `BYTE' previously declared here ---------------------------------------------------------------------- Hmm.... -- Take a look in Hagbard's World: | w3ng - The WWW Norton Guide reader. http://www.acemake.com/hagbard | ng2html - The NG to HTML converter. Also available in the UK: | eg - Norton Guide reader for OS/2. http://www.hagbard.demon.co.uk | dgscan - DGROUP scanner for Clipper.