From: Luca Boccassi Date: Wed, 6 Aug 2025 12:50:56 +0000 (+0100) Subject: test-bpf-token: fix build with libbpf < 0.6 X-Git-Tag: v258-rc3~74^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64a4f3110a72351d66f6815bf7b59993a0ed03d7;p=thirdparty%2Fsystemd.git test-bpf-token: fix build with libbpf < 0.6 ../s/src/test/test-bpf-token.c: In function ‘intro’: ../s/src/test/test-bpf-token.c:10:5: error: "__LIBBPF_CURRENT_VERSION_GEQ" is not defined, evaluates to 0 [-Werror=undef] 10 | #if __LIBBPF_CURRENT_VERSION_GEQ(1, 5) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../s/src/test/test-bpf-token.c:10:33: error: missing binary operator before token "(" 10 | #if __LIBBPF_CURRENT_VERSION_GEQ(1, 5) Follow-up for ea9826eb946d57aaba7e6bfa2d6b120136c6b20f --- diff --git a/src/test/test-bpf-token.c b/src/test/test-bpf-token.c index 3d6127182ec..ffdf822b8b3 100644 --- a/src/test/test-bpf-token.c +++ b/src/test/test-bpf-token.c @@ -7,7 +7,7 @@ #include "tests.h" static int intro(void) { -#if __LIBBPF_CURRENT_VERSION_GEQ(1, 5) +#if defined(LIBBPF_MAJOR_VERSION) && (LIBBPF_MAJOR_VERSION > 1 || (LIBBPF_MAJOR_VERSION == 1 && LIBBPF_MINOR_VERSION >= 5)) _cleanup_close_ int bpffs_fd = open("/sys/fs/bpf", O_RDONLY); if (bpffs_fd < 0) return log_error_errno(errno, "Failed to open '/sys/fs/bpf': %m");