From: Danny S. <dan...@cl...> - 2004-11-05 03:45:41
|
Aaron W. LaFramboise wrote: > Danny Smith wrote: > >> Aaron W. LaFramboise wrote: > >>> The comment also mentions that the guards would eventually go away. >>> How did the author anticipate that the file would be able to be >>> removed? Perhaps some sort of windres fixes? >> >> A script that modifies gcc's system headers to add the RC_INVOKED >> guard for windows targets (which is probably more acceptable than >> adding RC_INVOKED for >> everyone, but I may be wrong) > > It occurs to me suddenly that these sorts of guards are actually in > violation with the standard (in the case that standards-compliance is > requested with -ansi or -std). In other words, a conforming > implementation must accept this: > > #define RC_INVOKED > #include <stddef.h> > void *p = NULL; > > So, while its fine for users to use RC_INVOKED, and for RC/windres to > define RC_INVOKED, its unacceptable for system headers to modify their > behavior based on it. > > A way to fix this would be to have windres define _RC_INVOKED as well > as RC_INVOKED, and use that. And/or in _mingw.h #ifdef RC_INVOKED #ifndef _RC_INVOKED #define _RC_INVOKED 1 #endif #endif and use _RC_INVOKED This breaks using mingw-runtime with an > older version of binutils though. The only reasonable way to fix > this would be to have a configuration header that differed depending > on the version of binutils it was built with (or intended for). > While this isn't necessarily a problem, as some popular system C > libraries do this, mingw-runtime doesn't yet do this. Alternately, > newer mingw-runtimes would just have a higher prerequisit binutils > version when using windres, which might not be unreasonable. > > Note that Microsoft's RC does not have this problem. I think this is > because it uses a separate preprocessor. This is actually a bug in > windres: the windres preprocessor does not support everything required > by the RC format, such as the #@ preprocessor operator. > > > If the above issue was fixed somehow, I think it might be possible to > patch GCC's headers for _RC_INVOKED directly. All of these headers > are already incredibly hacked up by all sorts of unrepentantly weird > systems, and theres already a convenient place to add this macro > without even adding any lines, so I don't think this would be so bad. > > > Aaron W. LaFramboise > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > MinGW-dvlpr mailing list > Min...@li... > https://lists.sourceforge.net/lists/listinfo/mingw-dvlpr |