From 5aec4a5da32e9a1fad1a89f17b10d676d4312895 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Mon, 29 Jul 2019 22:46:20 +0200 Subject: Improve NetBSD port. (#361) Detect and link against ossaudio. Comment out unused code and functions. --- src/print_mem.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/print_mem.c') diff --git a/src/print_mem.c b/src/print_mem.c index 840f997..413067e 100644 --- a/src/print_mem.c +++ b/src/print_mem.c @@ -10,10 +10,14 @@ #define BINARY_BASE UINT64_C(1024) #define MAX_EXPONENT 4 + +#if defined(linux) static const char *const iec_symbols[MAX_EXPONENT + 1] = {"", "Ki", "Mi", "Gi", "Ti"}; static const char memoryfile_linux[] = "/proc/meminfo"; +#endif +#if defined(linux) /* * Prints the given amount of bytes in a human readable manner. * @@ -28,7 +32,9 @@ static int print_bytes_human(char *outwalk, uint64_t bytes) { } return sprintf(outwalk, "%.1f %sB", size, iec_symbols[exponent]); } +#endif +#if defined(linux) /* * Convert a string to its absolute representation based on the total * memory of `mem_total`. @@ -72,6 +78,7 @@ static long memory_absolute(const long mem_total, const char *size) { return mem_absolute; } +#endif void print_memory(yajl_gen json_gen, char *buffer, const char *format, const char *format_degraded, const char *threshold_degraded, const char *threshold_critical, const char *memory_used_method) { char *outwalk = buffer; -- cgit v1.2.3