Skip to content

Commit

Permalink
Fix build on darwin: stat structure
Browse files Browse the repository at this point in the history
  • Loading branch information
kirelagin committed Jun 16, 2019
1 parent 69b027b commit 0f92c1e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/System/Hatrace/Types.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0f92c1e

Please sign in to comment.