about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--freebsd/util.h11
-rw-r--r--xxxterm.c20
2 files changed, 21 insertions, 10 deletions
diff --git a/freebsd/util.h b/freebsd/util.h
new file mode 100644
index 0000000..5bab09f
--- /dev/null
+++ b/freebsd/util.h
@@ -0,0 +1,11 @@
+/*
+ * This file tries to make up for the difference between OpenBSD's
+ * <util.h> and FreeBSD's <libutil.h>.
+ */
+
+/*
+ * fmt_scaled(3) specific flags. (from OpenBSD util.h)
+ */
+#define FMT_SCALED_STRSIZE	7	/* minus sign, 4 digits, suffix, null byte */
+
+int	fmt_scaled(long long number, char *result);
diff --git a/xxxterm.c b/xxxterm.c
index 2bcebdb..2fc7173 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -42,16 +42,16 @@
 #include <errno.h>
 
 #include <sys/types.h>
-#ifdef __linux__
-        #include "linux/tree.h"
-        #include "linux/util.h"
-#else
-        #ifdef __FreeBSD__
-                #include <libutil.h>
-        #else
-                #include <util.h>
-        #endif
-        #include <sys/tree.h>
+#if defined(__linux__)
+	#include "linux/util.h"
+	#include "linux/tree.h"
+#elif defined(__FreeBSD__)
+	#include <libutil.h>
+	#include "freebsd/util.h"
+	#include <sys/tree.h>
+#else /* OpenBSD */
+	#include <util.h>
+	#include <sys/tree.h>
 #endif
 #include <sys/queue.h>
 #include <sys/stat.h>