diff --git a/src/hx/libs/std/Sys.cpp b/src/hx/libs/std/Sys.cpp index 371addf93..6479bc4d3 100644 --- a/src/hx/libs/std/Sys.cpp +++ b/src/hx/libs/std/Sys.cpp @@ -415,7 +415,12 @@ void _hx_std_sys_rename( String path, String newname ) hx::Throw(HX_CSTRING("Could not rename")); } -#define STATF(f) o->Add(HX_CSTRING(#f),(int)(s.st_##f)) +#define STATF32(f) o->Add(HX_CSTRING(#f),(int)(s.st_##f)) +#if defined(HXCPP_M64) || defined(HXCPP_ARM64) +#define STATF64(f) o->Add(HX_CSTRING(#f), static_cast(s.st_##f)) +#else +#define STATF64 STATF32 +#endif /** sys_stat : string -> { @@ -429,7 +434,7 @@ void _hx_std_sys_rename( String path, String newname ) nlink => int, rdev => int, mode => int, - size => int + size => long } Run the [stat] command on the given file or directory. **/ @@ -465,18 +470,17 @@ Dynamic _hx_std_sys_stat( String path ) return null(); hx::Anon o = hx::Anon_obj::Create(); - STATF(gid); - STATF(uid); - STATF(atime); - STATF(mtime); - STATF(ctime); - STATF(dev); - STATF(ino); - STATF(mode); - STATF(nlink); - STATF(rdev); - STATF(size); - STATF(mode); + STATF32(gid); + STATF32(uid); + STATF32(atime); + STATF32(mtime); + STATF32(ctime); + STATF32(dev); + STATF32(ino); + STATF32(nlink); + STATF32(rdev); + STATF32(mode); + STATF64(size); return o; #endif