[webkit-dev] IDL generation: [Conditional=XXX] vs. #if defined(ENABLE_XXX)

Patrick Gansterer paroga at paroga.com
Sun Jul 3 02:12:43 PDT 2011


IMO [Conditional=XXX] does not generate correct output (only tried JSC). It adds top many header includes.

Example with DOMWindow.idl:
The line
attribute [Conditional=DATABASE] SQLExceptionConstructor SQLException;
adds #include "JSSQLException.h" independently of ENABLE_DATABASE.

The lines 
#if defined(ENABLE_DATABASE) && ENABLE_DATABASE
attribute SQLExceptionConstructor SQLException;
#endif
generate the #include only if ENABLE_DATABSE is true.

If we add "JSSQLException.h" unconditionally we also need to generate the corresponding IDL all the time.

I see three possible solutions:
1) Always generate all IDL files.
2) Change all [Conditional=XXX] to #if define(ENABLE_XXX).
3) Add the correct #if ENABLE(XXX) around the header includes.

BTW: Should we unify the #if defined(ENABLE_XXX) and [Conditional=XX] in all IDL files?

- Patrick


More information about the webkit-dev mailing list