summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2011-11-03 23:12:56 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2011-11-03 23:13:05 +0100
commit2527948d197fbcb99bd19d3bbb7ec85440598060 (patch)
treef5aed57d9f8dabbbf0506235e921313080139661
parent99db29942570e5acf82c236757b62253c1c6f803 (diff)
downloadxmobar-2527948d197fbcb99bd19d3bbb7ec85440598060.tar.gz
xmobar-2527948d197fbcb99bd19d3bbb7ec85440598060.tar.bz2
Compilation errors in OpenBSD fixed
Hat tip Ivo van der Sangen.
-rw-r--r--NEWS1
-rw-r--r--src/StatFS.hsc8
2 files changed, 7 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 05a98f7..4d7a15b 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ _Bug fixes_
- Fix for pulseaudio problems in volume monitor (Martin Perner).
- Fix for parsing errors when a `Run` entry ended in an array
(Martin).
+ - Fixed compilation in OpenBSD (Ivo van der Sangen).
[issue 48]: http://code.google.com/p/xmobar/issues/detail?id=48
[issue 50]: http://code.google.com/p/xmobar/issues/detail?id=50
diff --git a/src/StatFS.hsc b/src/StatFS.hsc
index 391da68..871beb5 100644
--- a/src/StatFS.hsc
+++ b/src/StatFS.hsc
@@ -23,7 +23,11 @@ import Foreign.C.String
import Data.ByteString (useAsCString)
import Data.ByteString.Char8 (pack)
-#if defined (__FreeBSD__) || defined (__APPLE__)
+#if defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__APPLE__)
+#define IS_BSD_SYSTEM
+#endif
+
+#ifdef IS_BSD_SYSTEM
# include <sys/param.h>
# include <sys/mount.h>
#else
@@ -47,7 +51,7 @@ data FileSystemStats = FileSystemStats {
data CStatfs
-#if defined (__FreeBSD__) || defined (__APPLE__)
+#ifdef IS_BSD_SYSTEM
foreign import ccall unsafe "sys/mount.h statfs"
#else
foreign import ccall unsafe "sys/vfs.h statfs64"