diff options
author | Marcus von Appen <marcus@sysfault.org> | 2014-06-07 09:50:18 +0200 |
---|---|---|
committer | Marcus von Appen <marcus@sysfault.org> | 2014-06-07 09:50:18 +0200 |
commit | 585a3394df2bbfa863af619a5ea8a1d5a7b88266 (patch) | |
tree | 87a255f091993e4eee2789d7ad5776d456217d2a /unix/modtime.c | |
parent | c61be8e1e10a8c7bac3161cae531d26a9d754825 (diff) |
- Cast the struct stat sb.st_ino field to machine_int_t explicitly to avoid a
cast error in MP_OBJ_NEW_SMALL_INT(). This is necessary for FreeBSD, where
st_ino is of different size
- If MP_CLOCKS_PER_SEC is defined on the target host, simply define CLOCK_DIV
as a fraction, regardless of the value of MP_CLOCKS_PER_SEC.
FreeBSD uses a non-POSIX compliant value of 128 for CLOCKS_PER_SEC
Diffstat (limited to 'unix/modtime.c')
-rw-r--r-- | unix/modtime.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/unix/modtime.c b/unix/modtime.c index f957b9678..3cc09e3cd 100644 --- a/unix/modtime.c +++ b/unix/modtime.c @@ -55,10 +55,8 @@ void msec_sleep_tv(struct timeval *tv) { #define MP_CLOCKS_PER_SEC CLOCKS_PER_SEC #endif -#if defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000000) // POSIX -#define CLOCK_DIV 1000.0 -#elif defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000) // WIN32 -#define CLOCK_DIV 1.0 +#if defined(MP_CLOCKS_PER_SEC) +#define CLOCK_DIV (MP_CLOCKS_PER_SEC / 1000.0) #else #error Unsupported clock() implementation #endif |