Make it compile on OS X

pull/40/head
Massimo Gengarelli 2012-04-29 00:12:23 +02:00
parent 6f94393a5e
commit 867d1c3725
1 changed files with 5 additions and 1 deletions

View File

@ -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 )