hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/tools/lib/bpf/bpf.h
....@@ -241,8 +241,15 @@
241241 __u32 *buf_len, __u32 *prog_id, __u32 *fd_type,
242242 __u64 *probe_offset, __u64 *probe_addr);
243243
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
244250 enum bpf_stats_type; /* defined in up-to-date linux/bpf.h */
245251 LIBBPF_API int bpf_enable_stats(enum bpf_stats_type type);
252
+#endif
246253
247254 struct bpf_prog_bind_opts {
248255 size_t sz; /* size of this struct for forward/backward compatibility */