On September 11, 2002 06:18 am, Patrik Stridvall wrote:
However I might be able to write a very specialized parser, that pipes the .c files through the C preprosessor, that work all of the time, but this is quite some work as well.
But we shouldn't need that. Wine has a very good strucutre right now, and were that's broken, we can fix...
Sure. But what would tell you that it was broken?
winapi_check currently, among other thing, compares the .spec files with the source code.
When it reports something there are three possibillities 1. winapi_check is broken (because the code doesn't have good structure) 2. the .spec file is broken 3. the .c file is broken
Currently I check manually and I try to make an educated guess of which is the cases and then fix it.
If you extract the information from the source you don't have that luxury. If it misses a function or have some other bug you have no backup.
Since the .spec files exists winapi_check knows what functions it is expected to find in the source code and if is doesn't it reports it.
So if for example we have function Foo that looks like.
#define HELPER(x,y,z) DWORD WINAPI x(y arg1, z *arg1)
FOO(Bar, INT, HWND) { /* ... */ }
winapi_check will miss it (since it in an ad hoc parser), but since Bar is declared in some .spec file it will complain that Bar was never found. Then I manually search the source, and try to fix the problem somehow.
If you on the other hand extract the .spec files (of .def files) from the source the function Bar would be missed and you would never detect it...
That is why the parser needs to be so good that it "always" works.
On September 11, 2002 10:16 am, Patrik Stridvall wrote:
#define HELPER(x,y,z) DWORD WINAPI x(y arg1, z *arg1)
FOO(Bar, INT, HWND) { /* ... */ }
But we don't need to support that. If it doesn't get recognized, the function is not exported. You can manually look in the generated .spec file and see it's not there.
I don't think we need to be too clever. Just get the 80% that can be done with 20% of effort. It's a temporaray solution anyway: we need help from the compiler, writing a C parser (no, a gcc-C parser) is a lot of work. Mingw supports __declspec, Urlich, what would it take for the regular gcc to support it under Linux/ELF?
But beyond that, we can *today* compile Wine with Mingw as PE. So what we need is a checkspec make target which would run your script, compile Wine as PE, extract what needs extracting from there, and compare results. This does not need to happen all the time, only from time to time by some people that (1) have Mingw installed, and (2) care to do it :).