git: c680577ec993 - stable/13 - netlink.h: s/typeof/__typeof

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 08 Apr 2024 20:25:43 UTC
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=c680577ec993959cd6c76adcdc6b26930588e30b

commit c680577ec993959cd6c76adcdc6b26930588e30b
Author:     Lexi Winter <lexi@le-Fay.ORG>
AuthorDate: 2024-01-18 02:34:39 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-04-08 17:37:49 +0000

    netlink.h: s/typeof/__typeof
    
    typeof() does not exist in -std=c99 mode and the relevant #define is
    only for _KERNEL, so use __typeof here instead.
    
    Reviewed by:    jhb
    MFC after:      2 weeks
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1070
    
    (cherry picked from commit 4261507a5e3e73ef6f9535935d22785056954b19)
---
 sys/netlink/netlink.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netlink/netlink.h b/sys/netlink/netlink.h
index 9e6beef96cc6..ffbeb0a9c3f9 100644
--- a/sys/netlink/netlink.h
+++ b/sys/netlink/netlink.h
@@ -194,7 +194,7 @@ enum nlmsgerr_attrs {
 
 #define	NL_ITEM_OK(_ptr, _len, _hlen, _LEN_M)	\
 	((_len) >= _hlen && _LEN_M(_ptr) >= _hlen && _LEN_M(_ptr) <= (_len))
-#define	NL_ITEM_NEXT(_ptr, _LEN_M)	((typeof(_ptr))((char *)(_ptr) + _LEN_M(_ptr)))
+#define	NL_ITEM_NEXT(_ptr, _LEN_M)	((__typeof(_ptr))((char *)(_ptr) + _LEN_M(_ptr)))
 #define	NL_ITEM_ITER(_ptr, _len, _LEN_MACRO)	\
 	((_len) -= _LEN_MACRO(_ptr), NL_ITEM_NEXT(_ptr, _LEN_MACRO))