From 0f92c1eea0707cd485cec5c5d08cc146dce9dd90 Mon Sep 17 00:00:00 2001 From: Kirill Elagin Date: Fri, 14 Jun 2019 17:37:33 +0200 Subject: [PATCH] Fix build on darwin: stat structure --- src/System/Hatrace/Types.hsc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/System/Hatrace/Types.hsc b/src/System/Hatrace/Types.hsc index fcbb2b6..25ea091 100644 --- a/src/System/Hatrace/Types.hsc +++ b/src/System/Hatrace/Types.hsc @@ -101,9 +101,15 @@ instance Storable StatStruct where st_size <- #{peek struct stat, st_size} p st_blksize <- #{peek struct stat, st_blksize} p st_blocks <- #{peek struct stat, st_blocks } p +#ifdef __APPLE__ + st_atim <- #{peek struct stat, st_atimespec} p + st_mtim <- #{peek struct stat, st_mtimespec} p + st_ctim <- #{peek struct stat, st_ctimespec} p +#else st_atim <- #{peek struct stat, st_atim} p st_mtim <- #{peek struct stat, st_mtim} p st_ctim <- #{peek struct stat, st_ctim} p +#endif return StatStruct{..} poke p StatStruct{..} = do #{poke struct stat, st_dev} p st_dev @@ -116,9 +122,15 @@ instance Storable StatStruct where #{poke struct stat, st_size} p st_size #{poke struct stat, st_blksize} p st_blksize #{poke struct stat, st_blocks} p st_blocks +#ifdef __APPLE__ + #{poke struct stat, st_atimespec} p st_atim + #{poke struct stat, st_mtimespec} p st_mtim + #{poke struct stat, st_ctimespec} p st_ctim +#else #{poke struct stat, st_atim} p st_atim #{poke struct stat, st_mtim} p st_mtim #{poke struct stat, st_ctim} p st_ctim +#endif -- | following strace output instance HatraceShow StatStruct where