Skip to content

Commit

Permalink
libbpf: fixed build error for samples/bpf/
Browse files Browse the repository at this point in the history
Commit 8a138ae ("bpf: btf: Add BTF support to libbpf") did not
include stdbool.h, so GCC complained when building samples/bpf/.

In file included from /home/btopel/src/ext/linux/samples/bpf/libbpf.h:6:0,
                 from /home/btopel/src/ext/linux/samples/bpf/test_lru_dist.c:24:
/home/btopel/src/ext/linux/tools/lib/bpf/bpf.h:105:4: error: unknown type name ‘bool’; did you mean ‘_Bool’?
    bool do_log);
    ^~~~
    _Bool

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Björn Töpel authored and Daniel Borkmann committed Apr 20, 2018
1 parent 34df9d3 commit 878a4d3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/lib/bpf/bpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define __BPF_BPF_H

#include <linux/bpf.h>
#include <stdbool.h>
#include <stddef.h>

struct bpf_create_map_attr {
Expand Down

0 comments on commit 878a4d3

Please sign in to comment.