diff options
Diffstat (limited to 'innobase/ut/ut0ut.c')
-rw-r--r-- | innobase/ut/ut0ut.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c index b67be77b29e..18722149a8f 100644 --- a/innobase/ut/ut0ut.c +++ b/innobase/ut/ut0ut.c @@ -44,13 +44,13 @@ ut_get_high32( /* out: a >> 32 */ ulint a) /* in: ulint */ { -#if SIZEOF_LONG == 4 - UT_NOT_USED(a); + ib_longlong i; - return 0; -#else - return(a >> 32); -#endif + i = (ib_longlong)a; + + i = i >> 32; + + return((ulint)i); } /************************************************************ @@ -235,13 +235,18 @@ ut_get_year_month_day( *month = (ulint)cal_tm.wMonth; *day = (ulint)cal_tm.wDay; #else + struct tm cal_tm; struct tm* cal_tm_ptr; time_t tm; time(&tm); +#ifdef HAVE_LOCALTIME_R + localtime_r(&tm, &cal_tm); + cal_tm_ptr = &cal_tm; +#else cal_tm_ptr = localtime(&tm); - +#endif *year = (ulint)cal_tm_ptr->tm_year + 1900; *month = (ulint)cal_tm_ptr->tm_mon + 1; *day = (ulint)cal_tm_ptr->tm_mday; |