[PATCH] server: ifdefs guards for unistd.h and sys/types.h
unistd.h and sys/types.h should have ifdef HAVE_UNISTD_H and ifdef HAVE_SYS_TYPES_H guards, respectively. These includes were added in commit 8184bcc9 Signed-off-by: Craig Andrews <candrews(a)integralblue.com> --- server/token.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/token.c b/server/token.c index 820a7a0e07d..aec5aca12ac 100644 --- a/server/token.c +++ b/server/token.c @@ -26,8 +26,15 @@ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> + +#ifdef HAVE_SYS_TYPES_H #include <sys/types.h> +#endif + +#ifdef HAVE_UNISTD_H #include <unistd.h> +#endif + #include "ntstatus.h" #define WIN32_NO_STATUS -- 2.32.0
Craig Andrews <candrews(a)integralblue.com> writes:
unistd.h and sys/types.h should have ifdef HAVE_UNISTD_H and ifdef HAVE_SYS_TYPES_H guards, respectively.
These includes were added in commit 8184bcc9
Do you actually have a platform that requires this? -- Alexandre Julliard julliard(a)winehq.org
On 2021-10-19 04:50, Alexandre Julliard wrote:
Craig Andrews <candrews(a)integralblue.com> writes:
unistd.h and sys/types.h should have ifdef HAVE_UNISTD_H and ifdef HAVE_SYS_TYPES_H guards, respectively.
These includes were added in commit 8184bcc9
Do you actually have a platform that requires this?
I was tracking down a build failure of Wine 6.19 on Alpine, and I thought these guards may have something to do with it. However, I eventually realized that the fix for the build failure was commit e19ba44f231c668b044beaba018cf1afa3b92bd4. I figured I would still provide this guard patch to the mailing list though, since it improves consistency; almost all other uses of unistd.h and sys/types.h have these guards, so why not change that "almost all" to an "all?" Thanks, ~Craig
Craig Andrews <candrews(a)integralblue.com> writes:
On 2021-10-19 04:50, Alexandre Julliard wrote:
Craig Andrews <candrews(a)integralblue.com> writes:
unistd.h and sys/types.h should have ifdef HAVE_UNISTD_H and ifdef HAVE_SYS_TYPES_H guards, respectively. These includes were added in commit 8184bcc9 Do you actually have a platform that requires this?
I was tracking down a build failure of Wine 6.19 on Alpine, and I thought these guards may have something to do with it. However, I eventually realized that the fix for the build failure was commit e19ba44f231c668b044beaba018cf1afa3b92bd4.
I figured I would still provide this guard patch to the mailing list though, since it improves consistency; almost all other uses of unistd.h and sys/types.h have these guards, so why not change that "almost all" to an "all?"
There are essentially no guards for sys/types.h, and we shouldn't be adding them. There are some for unistd.h for Windows compatibility, but that's no longer an issue in most places. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Craig Andrews