------- Comment #5 from ktietz at gcc dot gnu dot org 2009-06-09 06:52 ------- (In reply to comment #4) > Subject: Re: GCC defines UNICODE instead of _UNICODE > for -municode > > UNICODE is in the user's namespace; it should not be predefined if > flag_iso (if you have to use specs rather than hooks, you need > %{!ansi:%{!std=i*:%{!std=c*:-DUNICODE}}} to detect the various conformance > options). We should not add to the instances of bug 545 that are still > present. If the MinGW headers use a macro in the user's namespace as a > feature test macro of some sort, they are buggy and should be fixed (with > fixincludes if necessary for existing installations). >
It is right that _UNICODE and UNICODE are in user name space defined and are controlling which API (wide/or ascii) has to be used. UNICODE is used in windows headers itself (see msdn for documentation). _UNICODE is used in CRT (and inspecial in tchar.h header) only. (This is also documented in msdn). I agree, that these two different macro names are a bit annoying, but for sure they are platform specific stuff and are for sure absolutely unrelated to ISO. Therefore to introduce a relationship to ISO defines is contradictive and wrong. Those macros are controling behaviour of runtime. By the windows specific switch -municode the windows runtime is controlled. Cheers, Kai -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40376