summaryrefslogtreecommitdiff
path: root/tools/lib/bpf/bpf.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-12-14 04:43:29 +0300
committerAlexei Starovoitov <ast@kernel.org>2019-12-16 02:58:05 +0300
commit544402d4b49332a4a9b2b8fff20f9d9f5ef86559 (patch)
treeaea0437dbae1de2c6db8bc2bf4fd50ad6bc7a191 /tools/lib/bpf/bpf.h
parent917f6b7b07a46e53fa73e112d23c97d1b201a877 (diff)
downloadlinux-544402d4b49332a4a9b2b8fff20f9d9f5ef86559.tar.xz
libbpf: Extract common user-facing helpers
LIBBPF_API and DECLARE_LIBBPF_OPTS are needed in many public libbpf API headers. Extract them into libbpf_common.h to avoid unnecessary interdependency between btf.h, libbpf.h, and bpf.h or code duplication. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20191214014341.3442258-6-andriin@fb.com
Diffstat (limited to 'tools/lib/bpf/bpf.h')
-rw-r--r--tools/lib/bpf/bpf.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
index 3c791fa8e68e..269807ce9ef5 100644
--- a/tools/lib/bpf/bpf.h
+++ b/tools/lib/bpf/bpf.h
@@ -28,14 +28,12 @@
#include <stddef.h>
#include <stdint.h>
+#include "libbpf_common.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef LIBBPF_API
-#define LIBBPF_API __attribute__((visibility("default")))
-#endif
-
struct bpf_create_map_attr {
const char *name;
enum bpf_map_type map_type;