"Guy L. Albertelli" wrote:
Recently had a problem with specmaker not generating
prototypes. Traced it
down to a problem in function_grep.pl.
If the following lines are in a .h file, no prototypes
after them are
recognized. Removing the lines from the .h file allows the
prototype to be
generated:
#define IShellIcon_METHODS \ ICOM_METHOD3(HRESULT, GetIconOf, \ LPCITEMIDLIST,pidl, UINT,flags, LPINT,lpIconIndex)
I suspect that the preprocessor elimination did not expect multiline condition.
Well, it knows about multiline directives but it doesn't handle all case properly.
I don't know perl so I cann't fix it.
thanks for sending the pb to me, but I didn't wrote that part at once (I just recently upgraded specmaker with some dump facilities) it seems however that the perl script only allow one backslash for multiline extensions but fails with more than one since Patrik seemed to have written this part at once (and it could/should be shared with the wineapi suite,
I borrowed (cut and paste) code from the winapi suite then I was writing function_grep.pl. It is a crude hack but it works (sort of at least).
And yes, function_grep.pl will be part of the winapi suite eventually but probably not in the next few months, but you never know.
I think he's the best suited for the fix... ;-)
Indeed. Here is a working fix I think (not tested). I found a bug in winapi_check a while ago but the fix didn't find its way the function_grep.pl it seems.
The problem might also be that there is whitespace after on of the :es. This is forbidden by ANSI C but most compilers accept it anyway.
Hmm. Thinking, modifying etc.
What about this?
Index: wine/tools/specmaker/function_grep.pl =================================================================== RCS file: /home/wine/wine/tools/specmaker/function_grep.pl,v retrieving revision 1.1 diff -u -u -r1.1 function_grep.pl --- wine/tools/specmaker/function_grep.pl 2001/01/04 19:45:50 1.1 +++ wine/tools/specmaker/function_grep.pl 2001/09/06 21:50:26 @@ -60,11 +60,12 @@ if(/^\s*$/) { next; }
# remove preprocessor directives - if(s/^\s*#/#/m) { - if(/^#.*?\$/m) { + if(s/^\s*#/#/s) { + if(/^#.*?\\s*\n/s) { $lookahead = 1; next; - } elsif(s/^#\s*(.*?)(\s+(.*?))?\s*$//m) { + } elsif(s/^#\s*\w+(?:\s+(.*?))?\s*$//s) { + $again = 1; next; } }