patches/ghc-xmobar-01-StatFS.hsc.diff
author jurikm
Sun, 12 Feb 2012 14:04:10 +0000
changeset 8245 383896da4129
parent 2859 92f1599a3175
permissions -rw-r--r--
SFEsauerbraten.spec: add IPS package name
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2859
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
     1
--- xmobar-0.11.1-orig/StatFS.hsc	2010-05-17 20:17:50.000000000 +1000
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
     2
+++ xmobar-0.11.1/StatFS.hsc	2010-07-21 22:38:52.755410000 +1000
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
     3
@@ -27,8 +27,14 @@
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
     4
 # include <sys/param.h>
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
     5
 # include <sys/mount.h>
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
     6
 #else
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
     7
+#if defined(__sun) && defined(__SVR4)
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
     8
+#include <sys/types.h>
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
     9
+#include <sys/statvfs.h>
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    10
+#define statfs statvfs
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    11
+#else
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    12
 #include <sys/vfs.h>
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    13
 #endif
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    14
+#endif
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    15
 
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    16
 data FileSystemStats = FileSystemStats {
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    17
   fsStatBlockSize :: Integer
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    18
@@ -50,8 +56,12 @@
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    19
 #if defined(__FreeBSD__)
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    20
 foreign import ccall unsafe "sys/mount.h statfs"
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    21
 #else
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    22
+#if defined(__sun) && defined(__SVR4)
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    23
+foreign import ccall unsafe "sys/statvfs.h statfs"
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    24
+#else
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    25
 foreign import ccall unsafe "sys/vfs.h statfs64"
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    26
 #endif
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    27
+#endif
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    28
   c_statfs :: CString -> Ptr CStatfs -> IO CInt
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    29
 
92f1599a3175 2010-07-21 Mark Wright <[email protected]>
markwright
parents:
diff changeset
    30
 toI :: CLong -> Integer