Chromium Code Reviews
DescriptionAttempt at improved OS macros
No actual changes to use this macro yet. Obviously an ARCH() could be similar.
No presubmit changes yet. The presubmit could just look for OS_<word> which becomes always wrong now.
The last 4 are difficult to defend against, as you can always do #if[def] MACAROON which will be false. Is PRESUBMIT sufficient for those cases? And are there other error cases the macro should attempt to defend against?
#if OS(MAC) // Compile time error.
#endif
#if OS(WINDOWS) // Compile time error.
#endif
#if OS(WEE) // Compile time error.
#endif
#if OS(MACOSX) // True iff __APPLE__
#endif
#if OS(WIN) // True iff _WIN32
#endif
#ifdef OS(WEE) // Compile time error, should be #if.
#endif
#ifdef OS(WIN) // Compile time error, should be #if.
#endif
#if defined OS(WEE) // Compile time error, should be #if.
#endif
#if defined OS(WIN) // Compile time error, should be #if.
#endif
#if defined(OS_WIN) // Always false, checked via PRESUBMIT.
#endif
#ifdef OS_WIN // Always false, checked via PRESUBMIT.
#endif
#if OS_WIN // Always false, checked via PRESUBMIT.
#endif
#if defined(OS_WINDOWS) // Always false, checked via PRESUBMIT
#endif
BUG=
Patch Set 1 #
Total comments: 1
Messages
Total messages: 3 (0 generated)
|
|||||||||||||||||||