.. | .. |
---|
241 | 241 | __u32 *buf_len, __u32 *prog_id, __u32 *fd_type, |
---|
242 | 242 | __u64 *probe_offset, __u64 *probe_addr); |
---|
243 | 243 | |
---|
| 244 | +#ifdef __cplusplus |
---|
| 245 | +/* forward-declaring enums in C++ isn't compatible with pure C enums, so |
---|
| 246 | + * instead define bpf_enable_stats() as accepting int as an input |
---|
| 247 | + */ |
---|
| 248 | +LIBBPF_API int bpf_enable_stats(int type); |
---|
| 249 | +#else |
---|
244 | 250 | enum bpf_stats_type; /* defined in up-to-date linux/bpf.h */ |
---|
245 | 251 | LIBBPF_API int bpf_enable_stats(enum bpf_stats_type type); |
---|
| 252 | +#endif |
---|
246 | 253 | |
---|
247 | 254 | struct bpf_prog_bind_opts { |
---|
248 | 255 | size_t sz; /* size of this struct for forward/backward compatibility */ |
---|