about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStevan Andjelkovic <stevan@student.chalmers.se>2011-01-17 01:43:34 +0000
committerStevan Andjelkovic <stevan@student.chalmers.se>2011-01-17 01:43:34 +0000
commit52a4311e6aeb3f0c14951c46b3259b277869aa3c (patch)
tree386fb8c40be8fb58debc1d0921d6cb6457f673e3
parentfcbe212face207de8c7e34c73d3da9e41e705d02 (diff)
downloadxombrero-52a4311e6aeb3f0c14951c46b3259b277869aa3c.tar.gz
Further attempts to make it compile on FreeBSD. ok marco@
-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>