No subject

Tue Aug 30 17:20:58 CDT 2005

< revision 1.15
< date: 2001/07/26 21:43:29;  author: julliard;  state: Exp;  lines: +1 =
< Patrik Stridvall <ps at>
< Removed inclusion of winnt.h because the porting layer shouldn't
< include Windows specific stuff.

Note that as the comment says we shouldn't include Windows specific =
in the porting layer.

>    One possible solution would be to handle DELETE differently, e.g.
> prefix it in Wine, and not prefix it for Winelib, or something like
> that. But wine/port.h is not the only header that needs to include
> 'config.h'. There is also:
>    cdrom.h console.h
>    ts_shape.h ts_xf86dga.h ts_xf86dga2.h ts_xf86vmode.h ts_xlib.h
>    ts_xpm.h ts_xresource.h ts_xshm.h ts_xutil.h ts_xvideo.h
>    wine_gl.h
>    x11drv.h
>    I think it would be wrong to move all these #includes so that they
> are first. Plus for the ts_*.h headers I am not sure it would be very
> good. Also #including config.h in these is a bit pointless=20
> since we know
> that the file including them will need to include config.h too.

Sounds reasonable.
>    So I propose the following instead:
>  * config.h has no multiple include protection. Add one=20
> macro).
>  * modify the above headers so that they don't include config.h but
> contain the following instead:
> #ifndef __WINE_CONFIG_H
> # error You must include config.h to use this header
> #endif
>    This will make sure that no-one forgets to include config.h when
> necessary.
>  * modify all files that include the above headers so that=20
> they include
> config.h as the first header. This actually requires relatively =
> work.

That is probably a good idea.

>  * do the same for port.h
>  * debugtools.h also uses config.h because it needs NO_DEBUG_MSGS and
> NO_TRACE_MSGS. Modify so that these are put on=20
> the command
> line instead. They are not the of the same nature as the other macros
> anyway: they are completely system independent. Also this will make =
> possible to use the Wine debug macros in Winelib applications. Then
> debugtools.h will no longer need to #include config.h. This cuts the
> number of files causing trouble in about half.

That is probably a good idea too.

>  * there are 3 other files that #include config.h for no good reason
> that I can see: gdi.h, heap.h and thread.h. Remove the #includes from
> there. Anyway, winapi_check ensures that all the .c files that need
> config.h already include it directly.

Yes. However that algoritm (or rather heuristics) that decide this is =
perfect but it catch most of the cases and the compiler catches a few =
and the linker most (all?) of the rest.

>  * maybe modify winapi_check to make sure that no header file =
> 'config.h' (this would be the frosting on the cake)

This is easy. I will do that if Alexandre accept a patch what requires =
>    Doing this (except for port.h) I have a tree that builds on =
> with no _FILE_OFFSET_BITS warning. So if the above sounds good, I =
> patches that are almost ready.

Ah. Good.

More information about the wine-devel mailing list