]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/bpf: replace "__auto_type" with "auto"
authorH. Peter Anvin <hpa@zytor.com>
Sun, 20 Jul 2025 06:46:29 +0000 (23:46 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 8 Dec 2025 23:32:15 +0000 (15:32 -0800)
Replace instances of "__auto_type" with "auto" in:

tools/testing/selftests/bpf/prog_tests/socket_helpers.h

This file does not seem to be including <linux/compiler_types.h>
directly or indirectly, so copy the definition but guard it with
!defined(auto).

Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
tools/testing/selftests/bpf/prog_tests/socket_helpers.h

index e02cabcc814e9a6a11d61ad02cf38696fb0f27ff..0d59503a0c73e44fc4043c9237e84fb8430cf158 100644 (file)
 #define VMADDR_CID_LOCAL 1
 #endif
 
+/* include/linux/compiler_types.h */
+#if __STDC_VERSION__ < 202311L && !defined(auto)
+# define auto __auto_type
+#endif
+
 /* include/linux/cleanup.h */
 #define __get_and_null(p, nullvalue)                                           \
        ({                                                                     \
-               __auto_type __ptr = &(p);                                      \
-               __auto_type __val = *__ptr;                                    \
+               auto __ptr = &(p);                                             \
+               auto __val = *__ptr;                                           \
                *__ptr = nullvalue;                                            \
                __val;                                                         \
        })