perf tools: Include errno.h where needed
[linux-2.6-block.git] / tools / perf / util / c++ / clang-c.h
CommitLineData
00b86691
WN
1#ifndef PERF_UTIL_CLANG_C_H
2#define PERF_UTIL_CLANG_C_H
3
edd695b0
WN
4#include <stddef.h> /* for size_t */
5#include <util-cxx.h> /* for __maybe_unused */
6
00b86691
WN
7#ifdef __cplusplus
8extern "C" {
9#endif
10
edd695b0 11#ifdef HAVE_LIBCLANGLLVM_SUPPORT
00b86691
WN
12extern void perf_clang__init(void);
13extern void perf_clang__cleanup(void);
14
15extern int test__clang_to_IR(void);
5e08a765 16extern int test__clang_to_obj(void);
00b86691 17
edd695b0
WN
18extern int perf_clang__compile_bpf(const char *filename,
19 void **p_obj_buf,
20 size_t *p_obj_buf_sz);
21#else
22
a43783ae 23#include <errno.h>
edd695b0
WN
24
25static inline void perf_clang__init(void) { }
26static inline void perf_clang__cleanup(void) { }
27
28static inline int test__clang_to_IR(void) { return -1; }
29static inline int test__clang_to_obj(void) { return -1;}
30
31static inline int
32perf_clang__compile_bpf(const char *filename __maybe_unused,
33 void **p_obj_buf __maybe_unused,
34 size_t *p_obj_buf_sz __maybe_unused)
35{
36 return -ENOTSUP;
37}
38
39#endif
40
00b86691
WN
41#ifdef __cplusplus
42}
43#endif
44#endif