pkgsrc/sysutils/open-vm-tools
コンパイルエラーの修正はこんなパッチで良いのかな…。
--- lib/hgfs/hgfsUtil.c.orig 2008-08-08 16:01:54.000000000 +0900 +++ lib/hgfs/hgfsUtil.c 2009-03-06 00:04:05.000000000 +0900 @@ -95,24 +95,22 @@ HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format uint64 ntTime) // IN: Time in Windows NT format { -#ifndef VM_X86_64 uint32 sec; uint32 nsec; ASSERT(unixTime); - /* We assume that time_t is 32bit */ - ASSERT_ON_COMPILE(sizeof (unixTime->tv_sec) == 4); - /* Cap NT time values that are outside of Unix time's range */ + if (sizeof(unixTime->tv_sec) == 4) { + /* We assume that time_t is 32bit */ - if (ntTime >= UNIX_S32_MAX) { - unixTime->tv_sec = 0x7FFFFFFF; - unixTime->tv_nsec = 0; - return 1; + /* Cap NT time values that are outside of Unix time's range */ + + if (ntTime >= UNIX_S32_MAX) { + unixTime->tv_sec = 0x7FFFFFFF; + unixTime->tv_nsec = 0; + return 1; + } } -#else - ASSERT(unixTime); -#endif if (ntTime < UNIX_EPOCH) { unixTime->tv_sec = 0; @@ -120,14 +118,14 @@ return -1; } -#ifndef VM_X86_64 - Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec); - unixTime->tv_sec = sec; - unixTime->tv_nsec = nsec * 100; -#else - unixTime->tv_sec = (ntTime - UNIX_EPOCH) / 10000000; - unixTime->tv_nsec = ((ntTime - UNIX_EPOCH) % 10000000) * 100; -#endif + if (sizeof(unixTime->tv_sec) == 4) { + Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec); + unixTime->tv_sec = sec; + unixTime->tv_nsec = nsec * 100; + } else { + unixTime->tv_sec = (ntTime - UNIX_EPOCH) / 10000000; + unixTime->tv_nsec = ((ntTime - UNIX_EPOCH) % 10000000) * 100; + } return 0; }