Re: git: fbd156d78fbd - main - Revert "nl_types.h: explicitly include cdefs.h"

From: Warner Losh <imp_at_bsdimp.com>
Date: Thu, 25 Jan 2024 04:48:03 UTC
Thanks Ed...

I think that

diff --git a/tools/build/cross-build/include/linux/sys/types.h
b/tools/build/cross-build/include/linux/sys/types.h
index 770b3057f8a8..e72e1419bccd 100644
--- a/tools/build/cross-build/include/linux/sys/types.h
+++ b/tools/build/cross-build/include/linux/sys/types.h
@@ -35,6 +35,11 @@
  */
 #pragma once

+/*
+ * FreeBSD's types.h always includes sys/cdefs.h, but Linux headers often
don't.
+ */
+#include <sys/cdefs.h>
+
 #include_next <sys/types.h>

 #ifndef __size_t

will filx the problem, but I can't test things easily enough.

Warner

On Wed, Jan 24, 2024 at 8:51 PM Ed Maste <emaste@freebsd.org> wrote:

> The branch main has been updated by emaste:
>
> URL:
> https://cgit.FreeBSD.org/src/commit/?id=fbd156d78fbdc5e1984afe4d83436b624e7a1f01
>
> commit fbd156d78fbdc5e1984afe4d83436b624e7a1f01
> Author:     Ed Maste <emaste@FreeBSD.org>
> AuthorDate: 2024-01-25 03:49:45 +0000
> Commit:     Ed Maste <emaste@FreeBSD.org>
> CommitDate: 2024-01-25 03:50:49 +0000
>
>     Revert "nl_types.h: explicitly include cdefs.h"
>
>     This isn't the right approach for addressing this cross-build issue.
>
>     This reverts commit 820401bf176996e41091d2e4190aded12a966b1d.
> ---
>  include/nl_types.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/include/nl_types.h b/include/nl_types.h
> index 6ba15132126d..120d1911631f 100644
> --- a/include/nl_types.h
> +++ b/include/nl_types.h
> @@ -34,7 +34,6 @@
>  #ifndef _NL_TYPES_H_
>  #define _NL_TYPES_H_
>
> -#include <sys/cdefs.h>
>  #include <sys/types.h>
>
>  #ifdef _NLS_PRIVATE
>