gshy2014 said:
Philp got my question: does the current OS affect the complier and turn
on a /D for a given macro. However, I am not clear about Philp's
answer. Philp, your answer is 'yes' or 'no'?
Now I don't know the question. Pick one:
A> At compile time, does the compiler detect the OS type and turn on
/DUNICODE?
B> At runtime, does the UNICODE macro change?
The answer to A is "Some compilation systems do that to some /D macros, and
they are all off-topic. I know of no Win32 compiler which does that for
UNICODE, and doing it would defeat the (off-topic) purpose of the UNICODE
macro, which is to compile for a target _different_ from the current OS -
either Win95-derived or WinNT-derived.
You will get a much better answer if you use Google Groups to find a topical
newsgroup, and then post a new, complete question to it.
(And the time has finally come to forget about any platform derived from
Win95!)
The answer to B is (on-topic) never ever ever, because all macros get
compiled at compile time. When they trigger "conditional compilation" (look
it up) the resulting code locks-down and never changes at runtime. Generally
speaking, only an 'if' statement will change things at runtime!
Richard Herring, Does you mean that some compliers and OS will
automatically determine what TCHAR is compiled as: wchar or char, and
the programmers need not turn on '/D' when compling?
No, they never will, and don't ask him that question again. Please read our
thread carefully to understand that we cannot give good answers to off-topic
questions here. We generally do our best to give bad answers, as a
cautionary tale. ;-)
Maybe, I posted an off-topic questions here. However, I think some C++
programmers will benefit from it.
Thanks, but that's not the point of topicality. I can review Richard's
answer, and he mine, when we answer an _on_topic_ question. But if you ask
an off-topic question about a system I know and Richard does not, he cannot
review or correct my answer. So posting to the most topical newsgroup (
probably ) is in everyone's best interests
here.