On Fri, Feb 19, 2010 at 10:18 AM, <[email protected]> wrote:

>
> Does it make a difference? I just copied this preprocessor-directives
> from frames-inl.h
>
>
It doesn't make any difference here because preprocessor macros defined on
the command line with no definition are 1 and undefined symbols are 0.

If it was defined to be zero via -DV8_TARGET_ARCH_IA32=0 or

#define V8_TARGET_ARCH_IA32 0

it would make a difference, in which case it is true that #ifdef
V8_TARGET_ARCH_IA32 but false that #if V8_TARGET_ARCH_IA32.

Anyway we should be consistent.

~/v8/src$ grep "#ifdef " *.h *.cc */*.h */*.cc | wc -l
790
~/v8/src$ grep "#if " *.h *.cc */*.h */*.cc | wc -l
113

and some occurrences of #if are complicated expressions where #ifdef or
#ifndef do not work, so it seems that #ifdef wins for new code.

-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to