Hi,


   I have this RC file that comes from the Petzold and that will not
compile with wrc. The reason it will not compile is that it includes an
include file, resource.h, which contains:

  UINT CALLBACK StylePageProc (HWND, UINT, LPPROPSHEETPAGE) ;

   The reason it does not compile is that WRC does not consider this to
be a function declaration. To wrc a function declaration has 2
identifiers followed by an opening parenthesis. Here, even after the
preprocessing, we have three. In fact we may have even more. The
well-known 'extern const unsigned long int* foo()' immediately comes to
mind.

   I checked how rc (from VC6) handles this and made the following
observations:
 - you cannot put even a basic 'int foo();' in the RC file
 - you can put any garbage you want in any of the included files
 - the only things that rc checks for in included files are:
   - comments /*...*/ and //
   - strings, sort of (there's something fishy happening if you put a
'\' at the end of the line
   - preprocessor directives, i.e. lines starting with a #
 - no, it does not care about balanced parenthesis, braces, semi-olons
or anything of the sort


   On the other hand wrc tries very hard to preprocess everything
correctly. But should we really do this? Wouldn't it be simpler and
better (for compatibility) to just tell the preprocessor not to worry
about what's in include files like rc does?



-- 
Francois Gouget
[EMAIL PROTECTED]

Reply via email to