diff --git a/src/bpf.h b/src/bpf.h index 6fffb3c..f35146c 100644 --- a/src/bpf.h +++ b/src/bpf.h @@ -29,6 +29,7 @@ #include #include "libbpf_common.h" +#include "libbpf_legacy.h" #ifdef __cplusplus extern "C" { diff --git a/src/libbpf_common.h b/src/libbpf_common.h index aaa1efb..0967112 100644 --- a/src/libbpf_common.h +++ b/src/libbpf_common.h @@ -54,7 +54,7 @@ * including any extra padding, it with memset() and then assigns initial * values provided by users in struct initializer-syntax as varargs. */ -#define DECLARE_LIBBPF_OPTS(TYPE, NAME, ...) \ +#define LIBBPF_OPTS(TYPE, NAME, ...) \ struct TYPE NAME = ({ \ memset(&NAME, 0, sizeof(struct TYPE)); \ (struct TYPE) { \ diff --git a/src/libbpf_legacy.h b/src/libbpf_legacy.h index 5ba5c9b..bb03c56 100644 --- a/src/libbpf_legacy.h +++ b/src/libbpf_legacy.h @@ -69,6 +69,7 @@ enum libbpf_strict_mode { LIBBPF_API int libbpf_set_strict_mode(enum libbpf_strict_mode mode); +#define DECLARE_LIBBPF_OPTS LIBBPF_OPTS #ifdef __cplusplus } /* extern "C" */