[PATCH 0/1] MR217: include: Use WIN32_LEAN_AND_MEAN to exlude non-required headers
Reference https://bugs.winehq.org/show_bug.cgi?id=54985
From the line we see the mingw version used causes an In file included from /usr/share/mingw-w64/include/unknwnbase.h:47, [ 935s] from /usr/share/mingw-w64/include/objidlbase.h:439, [ 935s] from include/combaseapi.h:29, [ 935s] from include/objbase.h:267, [ 935s] from include/ole2.h:25, [ 935s] from /usr/share/mingw-w64/include/wtypes.h:13, [ 935s] from include/winscard.h:22, [ 935s] from include/windows.h:68, [ 935s] from libs/vkd3d/include/private/vkd3d_common.h:23, [ 935s] from libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h:49, [ 935s] from libs/vkd3d/libs/vkd3d-shader/preproc.y:24, [ 935s] from libs/vkd3d/libs/vkd3d-shader/preproc.l:23: [ 935s] /usr/share/mingw-w64/include/wtypesbase.h:148:16: error: redefinition of 'struct _SECURITY_ATTRIBUTES' [ 935s] 148 | typedef struct _SECURITY_ATTRIBUTES {
The included file winscard.h seemed a little odd. The vkd3d isn't going to use this. Adding the define WIN32_LEAN_AND_MEAN to the Makefile.in (in wine), produce the following warnings. /home/alesliehughes/wine/libs/vkd3d/include/private/vkd3d_common.h:75:5: warning: implicit declaration of function ‘abort’ [-Wimplicit-function-declaration] 75 | abort(); | ^~~~~ /home/alesliehughes/wine/libs/vkd3d/include/private/vkd3d_common.h:258:14: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration] 258 | *major = atoi(version); Adding header <stdlib.h> removed all the warnings. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/217
From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Reference https://bugs.winehq.org/show_bug.cgi?id=54985
From the line we see the mingw version used causes an In file included from /usr/share/mingw-w64/include/unknwnbase.h:47, [ 935s] from /usr/share/mingw-w64/include/objidlbase.h:439, [ 935s] from include/combaseapi.h:29, [ 935s] from include/objbase.h:267, [ 935s] from include/ole2.h:25, [ 935s] from /usr/share/mingw-w64/include/wtypes.h:13, [ 935s] from include/winscard.h:22, [ 935s] from include/windows.h:68, [ 935s] from libs/vkd3d/include/private/vkd3d_common.h:23, [ 935s] from libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h:49, [ 935s] from libs/vkd3d/libs/vkd3d-shader/preproc.y:24, [ 935s] from libs/vkd3d/libs/vkd3d-shader/preproc.l:23: [ 935s] /usr/share/mingw-w64/include/wtypesbase.h:148:16: error: redefinition of 'struct _SECURITY_ATTRIBUTES' [ 935s] 148 | typedef struct _SECURITY_ATTRIBUTES {
The included file winscard.h seemed a little odd. The vkd3d isn't going to use this. Adding the define WIN32_LEAN_AND_MEAN to the Makefile.in (in wine), produce the following warnings. /home/alesliehughes/wine/libs/vkd3d/include/private/vkd3d_common.h:75:5: warning: implicit declaration of function ‘abort’ [-Wimplicit-function-declaration] 75 | abort(); | ^~~~~ /home/alesliehughes/wine/libs/vkd3d/include/private/vkd3d_common.h:258:14: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration] 258 | *major = atoi(version); Adding header <stdlib.h> removed all the warnings. --- include/private/vkd3d_common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h index 4f9dc4d6..6be3cee8 100644 --- a/include/private/vkd3d_common.h +++ b/include/private/vkd3d_common.h @@ -20,6 +20,7 @@ #define __VKD3D_COMMON_H #include "config.h" +#define WIN32_LEAN_AND_MEAN #include "vkd3d_windows.h" #include "vkd3d_types.h" @@ -28,6 +29,7 @@ #include <stdbool.h> #include <stdint.h> #include <stdio.h> +#include <stdlib.h> #ifdef _MSC_VER #include <intrin.h> -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/217
This merge request was approved by Giovanni Mascellani. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/217
Note that this is fixed in Wine by including preproc.h in preproc.l, so that we generate the correct dependencies. You probably want to do that in wine-staging too. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/217#note_34064
Adjusted my script to do this. However, doesn't it still make sense to exclude headers that are never going to be used in vkd3d? -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/217#note_34123
However, doesn't it still make sense to exclude headers that are never going to be used in vkd3d?
Sure, I think that's fine. That would require a slightly different commit message though. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/217#note_34132
On Mon Jun 19 10:14:55 2023 +0000, Henri Verbeet wrote:
However, doesn't it still make sense to exclude headers that are never going to be used in vkd3d? Sure, I think that's fine. That would require a slightly different commit message though. What would you suggest as the comment message?
-- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/217#note_36105
What would you suggest as the comment message?
I'd remove the reference to the Wine bug report, and say something along the lines of "Avoid including unnecessary Windows headers; we only require a few types and declarations. This slightly reduces Win32 build times." (Provided the latter part is true, of course; I didn't check!) -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/217#note_36247
participants (5)
-
Alexandre Julliard (@julliard) -
Alistair Leslie-Hughes -
Alistair Leslie-Hughes (@alesliehughes) -
Giovanni Mascellani (@giomasce) -
Henri Verbeet (@hverbeet)