Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: replace "__auto_type" with "auto"

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>

+7 -2
+7 -2
tools/testing/selftests/bpf/prog_tests/socket_helpers.h
··· 17 17 #define VMADDR_CID_LOCAL 1 18 18 #endif 19 19 20 + /* include/linux/compiler_types.h */ 21 + #if __STDC_VERSION__ < 202311L && !defined(auto) 22 + # define auto __auto_type 23 + #endif 24 + 20 25 /* include/linux/cleanup.h */ 21 26 #define __get_and_null(p, nullvalue) \ 22 27 ({ \ 23 - __auto_type __ptr = &(p); \ 24 - __auto_type __val = *__ptr; \ 28 + auto __ptr = &(p); \ 29 + auto __val = *__ptr; \ 25 30 *__ptr = nullvalue; \ 26 31 __val; \ 27 32 })