Patrik Stridvall <ps(a)leissner.se> writes:
This will be VERY slow.
I don't think it will be really different than duplicating all the work the preprocessor is doing inside the parser itself. Of course you want to use the Wine preprocessor, not fork+exec gcc for each file. But yes parsing all the files is of course slower than having all the info in the .spec, there's no way around that.
You now know where a __declspec function begins and ends. This reduces the problem to the parsing of a function declaration. The rest is left as an exersize to the reader. :-)
All you really need is the function name, which should be the last token before the opening '('. The only problem is if you want to find the number of args for stdcall decoration, but we should be able to do without it.
The problem is that this might work or it might not. You have no real guarante that it will.
Well the thing is if you find a declspec you output what you think is the function name. If you get it wrong and output 'WINAPI' or 'char*' instead you'll notice it at build time. -- Alexandre Julliard julliard(a)winehq.com