"Dimitrie O. Paun" dpaun@rogers.com writes:
I know, it would be nice to have an intelligent utility to cleanup the headers, but by the looks of it, it has to be rather smart. This is probably one of the more difficult cleanups, and I did it all by hand, which gave me a chance to cleanup/reorganize the includes a bit.
Looks like you have been reorganizing a bit too much, config.h and wine/port.h should always be included before anything else.
All other (except for winbase.h) are *a lot* simpler. People can do them by hand quite easily.
I'm not so sure. For instance prsht.h still includes windef.h, wingdi.h and winuser.h, and since it's included from commctrl.h in fact your patch didn't actually remove these. I think there will still be a lot of changes to make, and I'd really prefer to avoid having to fix the same C files again and again.
On Thu, 4 Sep 2003, Alexandre Julliard wrote:
Looks like you have been reorganizing a bit too much, config.h and wine/port.h should always be included before anything else.
I did not realize this. We don't (or we shouldn't) test for HAVE_* in our header files (except port.h), so I was only aware of config.h being included before port.h.
All other (except for winbase.h) are *a lot* simpler. People can do them by hand quite easily.
I'm not so sure. For instance prsht.h still includes windef.h, wingdi.h and winuser.h, and since it's included from commctrl.h in fact your patch didn't actually remove these.
Yeah, I noticed that too after I finished, but I don't think it's a big problem anymore because commctrl.h is typically included after a lot of other headers which would generate errors if win{def,base,etc} were not included before.
I think there will still be a lot of changes to make, and I'd really prefer to avoid having to fix the same C files again and again.
In other words? Is it OK if I fix prsht.h as well? It was a lot of work you know...
"Dimitrie O. Paun" dimi@intelliware.ca writes:
I think there will still be a lot of changes to make, and I'd really prefer to avoid having to fix the same C files again and again.
In other words? Is it OK if I fix prsht.h as well? It was a lot of work you know...
In other words we need to fix all the headers at once, and apply one big patch that fixes all the C files that need fixing in one step. I know it's a lot of work, that's why I suggested writing a script...
On Thu, 4 Sep 2003, Alexandre Julliard wrote:
In other words we need to fix all the headers at once, and apply one big patch that fixes all the C files that need fixing in one step. I know it's a lot of work, that's why I suggested writing a script...
I have a lot more changes (cleanup of winnt.h), do you want me to drop them all? Fixing _all_ headers is a big task, I don't understand why we can't do it in distinct chunks....
"Dimitrie O. Paun" dimi@intelliware.ca writes:
I have a lot more changes (cleanup of winnt.h), do you want me to drop them all? Fixing _all_ headers is a big task, I don't understand why we can't do it in distinct chunks....
Because such large scale changes are a real pain for everybody who has local changes; we can't really avoid changing every file, but we can avoid changing every file 10 times. Besides, we'll need a script to fix winbase.h, so we might as well use it for the others too.
Anyway, just to show it can be done here's the beginning of such a script; you can do 'fix-includes windef.h winbase.h <files>' and it will make sure all the files listed include windef.h before winbase.h without making unnecessary changes. It's not perfect yet, but it sure beats doing everything by hand...
On September 4, 2003 07:08 pm, Alexandre Julliard wrote:
Anyway, just to show it can be done here's the beginning of such a script; you can do 'fix-includes windef.h winbase.h <files>' and it will make sure all the files listed include windef.h before winbase.h without making unnecessary changes. It's not perfect yet, but it sure beats doing everything by hand...
This works well for the three big ones: windef.h/winbase.h/winuser.h For other we will include a lot on unnecessary headers. For example, ntstatus.h is not needed in many files that include winnt.h.
I continue from my changes and deal with the rest of the files using your script, if that's OK with you. If not, just let me know and I'll drop what I've been doing (yeah, I've touch a few config.h/port.h but I can fix those).
"Dimitrie O. Paun" dpaun@rogers.com writes:
This works well for the three big ones: windef.h/winbase.h/winuser.h For other we will include a lot on unnecessary headers. For example, ntstatus.h is not needed in many files that include winnt.h.
Yes, ntstatus.h is a bit different, and probably has to be done by hand.
I continue from my changes and deal with the rest of the files using your script, if that's OK with you. If not, just let me know and I'll drop what I've been doing (yeah, I've touch a few config.h/port.h but I can fix those).
Actually I've been playing with my script for a bit, and I now have fixed pretty much all the major issues, so you probably don't want to work on it any more at this point. But if you have a patch for ntstatus.h that you could send me that would be useful.
On September 4, 2003 08:37 pm, Alexandre Julliard wrote:
Actually I've been playing with my script for a bit, and I now have fixed pretty much all the major issues, so you probably don't want to work on it any more at this point. But if you have a patch for ntstatus.h that you could send me that would be useful.
It's not small -- just commit your changes, let me merge and take it from there. My tree is modified up the wazoo, I have to see where I stand before I can send anything out.