In message <[email protected]> Martin Wuerthner <[email protected]> wrote:
> In message <[email protected]> > Ron <[email protected]> wrote: > > > In message <[email protected]> > > Ron <[email protected]> wrote: > > >> I have a compiler error with > >> static enum { RESET, RAW, CBREAK } ttystate = RESET; > >> > >> It seems that RAW and CBREAK are defined in <sys/ioctl> but there is > >> nothing around for RESET. > >> > > OK, It compiles if I change the spelling of RAW and CBREAK to an unknown. > > So it may be that the problem is that those two have been defined, and > > this function wants to set them at 0, 1, 2 ? > > The above is perfectly valid code, but any perfectly valid code that > makes use of identifiers or keywords can be broken by previous > #defines. If the file with the above code #includes <sys/ioctl.h>, > which #defines RAW and CBREAK as numeric constants, then you get a > compiler error because the compiler sees numbers instead of the > identifiers RAW and CBREAK in the enum declaration. That is a name > conflict between this code and the contents of <sys/ioctl.h>. > > At a guess, the above code was meant to be used as a fallback > implementation on platforms that do not have <sys/ioctl.h> available. > > Martin Yes <sys/ioctl> is included for the library I am building, but there is probably various implementations of <sys/ioctl also. I'm not sure wether to change the names in the ttymode.c or to undefine CBREAK and RAW in <sys/ioctl>. If another program in the suite wants to use the names, it may be better to undefine them in <sys/ioctl> so I can keep them as is. Thanks for demystifying things a bit, anyway. Ron M. _______________________________________________ GCCSDK mailing list [email protected] Bugzilla: http://www.riscos.info/bugzilla/index.cgi List Info: http://www.riscos.info/mailman/listinfo/gcc Main Page: http://www.riscos.info/index.php/GCCSDK
