Permalink
Browse files

Make it compile on OS X

  • Loading branch information...
Massimo Gengarelli
Massimo Gengarelli committed Apr 28, 2012
1 parent 6f94393 commit 867d1c3725c55b042df577ff1feb4cac7662171c
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/util/OS.cc
View
@@ -40,7 +40,11 @@ DateTime FileMTime( const std::string& filename )
if ( ::stat( filename.c_str(), &s ) != 0 )
throw std::runtime_error( "cannot get file attribute of " + filename ) ;
- return DateTime( s.st_mtim.tv_sec, s.st_mtim.tv_nsec ) ;
+#ifdef __APPLE__ && __DARWIN_64_BIT_INO_T
+ return DateTime( s.st_mtimespec.tv_sec, s.st_mtimespec.tv_nsec ) ;
+#else
+ return DateTime( s.st_mtim.tv_sec, s.st_mtim.tv_nsec);
+#endif
}
void SetFileTime( const std::string& filename, const DateTime& t )

0 comments on commit 867d1c3

Please sign in to comment.