Kouhei Sutou
null+****@clear*****
Fri Jan 30 17:27:26 JST 2015
Kouhei Sutou 2015-01-30 17:27:26 +0900 (Fri, 30 Jan 2015) New Revision: a29eee18b33b47539515d8438b782ad350483937 https://github.com/groonga/groonga/commit/a29eee18b33b47539515d8438b782ad350483937 Message: windows: check "64" version Because localtime_s() and gmtime_s() are inline functions. So we need to include time.h to use them. But we don't have a way to check function with including header file. Modified files: build/ac_macros/check_functions.m4 config.h.cmake lib/ctx.c lib/str.c Modified: build/ac_macros/check_functions.m4 (+2 -2) =================================================================== --- build/ac_macros/check_functions.m4 2015-01-30 16:32:04 +0900 (462f63d) +++ build/ac_macros/check_functions.m4 2015-01-30 17:27:26 +0900 (ee1878e) @@ -4,9 +4,9 @@ AC_CHECK_FUNCS(_stricmp) AC_CHECK_FUNCS(_strnicmp) AC_CHECK_FUNCS(_strtoui64) AC_CHECK_FUNCS(close) -AC_CHECK_FUNCS(gmtime_s) +AC_CHECK_FUNCS(gmtime64_s) AC_CHECK_FUNCS(gmtime_r) -AC_CHECK_FUNCS(localtime_s) +AC_CHECK_FUNCS(localtime64_s) AC_CHECK_FUNCS(localtime_r) AC_CHECK_FUNCS(mkostemp) AC_CHECK_FUNCS(open) Modified: config.h.cmake (+2 -2) =================================================================== --- config.h.cmake 2015-01-30 16:32:04 +0900 (3fd1e64) +++ config.h.cmake 2015-01-30 17:27:26 +0900 (8998d48) @@ -141,9 +141,9 @@ #cmakedefine HAVE_CLOCK_GETTIME #cmakedefine HAVE_CLOSE #cmakedefine HAVE_FPCLASSIFY -#cmakedefine HAVE_GMTIME_S +#cmakedefine HAVE_GMTIME64_S #cmakedefine HAVE_GMTIME_R -#cmakedefine HAVE_LOCALTIME_S +#cmakedefine HAVE_LOCALTIME64_S #cmakedefine HAVE_LOCALTIME_R #cmakedefine HAVE_MKOSTEMP #cmakedefine HAVE_OPEN Modified: lib/ctx.c (+3 -3) =================================================================== --- lib/ctx.c 2015-01-30 16:32:04 +0900 (b0480ed) +++ lib/ctx.c 2015-01-30 17:27:26 +0900 (b9e4e79) @@ -134,12 +134,12 @@ grn_timeval2str(grn_ctx *ctx, grn_timeval *tv, char *buf) { struct tm *ltm; const char *function_name; -#ifdef HAVE_LOCALTIME_S +#ifdef HAVE_LOCALTIME64_S struct tm tm; time_t t = tv->tv_sec; function_name = "localtime_s"; ltm = (localtime_s(&tm, &t) == 0) ? &tm : NULL; -#else /* HAVE_LOCALTIME_S */ +#else /* HAVE_LOCALTIME64_S */ # ifdef HAVE_LOCALTIME_R struct tm tm; time_t t = tv->tv_sec; @@ -150,7 +150,7 @@ grn_timeval2str(grn_ctx *ctx, grn_timeval *tv, char *buf) function_name = "localtime"; ltm = localtime(&tvsec); # endif /* HAVE_LOCALTIME_R */ -#endif /* HAVE_LOCALTIME_S */ +#endif /* HAVE_LOCALTIME64_S */ if (!ltm) { SERR(function_name); } snprintf(buf, GRN_TIMEVAL_STR_SIZE - 1, GRN_TIMEVAL_STR_FORMAT, ltm->tm_year + 1900, ltm->tm_mon + 1, ltm->tm_mday, Modified: lib/str.c (+1 -1) =================================================================== --- lib/str.c 2015-01-30 16:32:04 +0900 (c04feae) +++ lib/str.c 2015-01-30 17:27:26 +0900 (63efbc9) @@ -2441,7 +2441,7 @@ grn_text_time2rfc1123(grn_ctx *ctx, grn_obj *bulk, int sec) { time_t tsec; struct tm *t; -#ifdef HAVE_GMTIME_S +#ifdef HAVE_GMTIME64_S struct tm tm; tsec = (time_t)sec; t = (gmtime_s(&tm, &tsec) == 0) ? &tm : NULL; -------------- next part -------------- HTML����������������������������...Download