[PATCH v3 1/3] tools: perf: add dummy functions for !HAVE_LZMA_SUPPORT
From: Stephen Brennan
Date: Fri Mar 07 2025 - 18:22:37 EST
This allows us to use them without needing to ifdef the calling code.
Signed-off-by: Stephen Brennan <stephen.s.brennan@xxxxxxxxxx>
---
tools/perf/util/compress.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/perf/util/compress.h b/tools/perf/util/compress.h
index b29109cd36095..a7650353c6622 100644
--- a/tools/perf/util/compress.h
+++ b/tools/perf/util/compress.h
@@ -5,6 +5,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <sys/types.h>
+#include <linux/compiler.h>
#ifdef HAVE_ZSTD_SUPPORT
#include <zstd.h>
#endif
@@ -17,6 +18,17 @@ bool gzip_is_compressed(const char *input);
#ifdef HAVE_LZMA_SUPPORT
int lzma_decompress_to_file(const char *input, int output_fd);
bool lzma_is_compressed(const char *input);
+#else
+static inline
+int lzma_decompress_to_file(const char *input __maybe_unused,
+ int output_fd __maybe_unused)
+{
+ return -1;
+}
+static inline int lzma_is_compressed(const char *input __maybe_unused)
+{
+ return false;
+}
#endif
struct zstd_data {
--
2.43.5