From 187d5dfde9e65c167acd9d07ac8d75b2c60db187 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Thu, 24 Oct 2013 14:07:53 -0600 Subject: [PATCH] fix darwin build --- classpath/java-io.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/classpath/java-io.cpp b/classpath/java-io.cpp index 083df06133..e6f7f8a55d 100644 --- a/classpath/java-io.cpp +++ b/classpath/java-io.cpp @@ -590,9 +590,13 @@ Java_java_io_File_lastModified(JNIEnv* e, jclass, jstring path) if (res == -1) { return 0; } - - return (static_cast(fileStat.st_mtim.tv_sec) * 1000) + - (static_cast(fileStat.st_mtim.tv_nsec) / (1000*1000)); +# ifdef __APPLE__ + #define MTIME st_mtimespec +# else + #define MTIME st_mtim +# endif + return (static_cast(fileStat.MTIME.tv_sec) * 1000) + + (static_cast(fileStat.MTIME.tv_nsec) / (1000*1000)); #endif }