Skip to content

Commit c278d72

Browse files
author
H. Peter Anvin
committed
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>
1 parent 2a5b286 commit c278d72

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@
1717
#define VMADDR_CID_LOCAL 1
1818
#endif
1919

20+
/* include/linux/compiler_types.h */
21+
#if __STDC_VERSION__ < 202311L && !defined(auto)
22+
# define auto __auto_type
23+
#endif
24+
2025
/* include/linux/cleanup.h */
2126
#define __get_and_null(p, nullvalue) \
2227
({ \
23-
__auto_type __ptr = &(p); \
24-
__auto_type __val = *__ptr; \
28+
auto __ptr = &(p); \
29+
auto __val = *__ptr; \
2530
*__ptr = nullvalue; \
2631
__val; \
2732
})

0 commit comments

Comments
 (0)