Kouhei Sutou
null+****@clear*****
Fri Jan 30 16:30:25 JST 2015
Kouhei Sutou 2015-01-30 16:30:25 +0900 (Fri, 30 Jan 2015) New Revision: ab77e6e474c142992d36b4e3b41f1bc7b313fddf https://github.com/groonga/groonga/commit/ab77e6e474c142992d36b4e3b41f1bc7b313fddf Message: Revert "windows: try to add "_" prefix" This reverts commit 4b6f2baed16f2c67894e06a4a5b01dd869239055. Because both of _gmtime_s() and _localtimes_s() aren't found... 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:10:47 +0900 (b8ce049) +++ build/ac_macros/check_functions.m4 2015-01-30 16:30:25 +0900 (462f63d) @@ -1,12 +1,12 @@ # -*- autoconf -*- -AC_CHECK_FUNCS(_gmtime_s) -AC_CHECK_FUNCS(_localtime_s) AC_CHECK_FUNCS(_stricmp) AC_CHECK_FUNCS(_strnicmp) AC_CHECK_FUNCS(_strtoui64) AC_CHECK_FUNCS(close) +AC_CHECK_FUNCS(gmtime_s) AC_CHECK_FUNCS(gmtime_r) +AC_CHECK_FUNCS(localtime_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:10:47 +0900 (649ca4d) +++ config.h.cmake 2015-01-30 16:30:25 +0900 (3fd1e64) @@ -133,8 +133,6 @@ #cmakedefine HAVE_MECAB_DICTIONARY_INFO_T /* functions */ -#cmakedefine HAVE__GMTIME_S -#cmakedefine HAVE__LOCALTIME_S #cmakedefine HAVE__STRICMP #cmakedefine HAVE__STRNICMP #cmakedefine HAVE__STRTOUI64 @@ -143,7 +141,9 @@ #cmakedefine HAVE_CLOCK_GETTIME #cmakedefine HAVE_CLOSE #cmakedefine HAVE_FPCLASSIFY +#cmakedefine HAVE_GMTIME_S #cmakedefine HAVE_GMTIME_R +#cmakedefine HAVE_LOCALTIME_S #cmakedefine HAVE_LOCALTIME_R #cmakedefine HAVE_MKOSTEMP #cmakedefine HAVE_OPEN Modified: lib/ctx.c (+5 -5) =================================================================== --- lib/ctx.c 2015-01-30 16:10:47 +0900 (4b56a12) +++ lib/ctx.c 2015-01-30 16:30:25 +0900 (b0480ed) @@ -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_LOCALTIME_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 */ + function_name = "localtime_s"; + ltm = (localtime_s(&tm, &t) == 0) ? &tm : NULL; +#else /* HAVE_LOCALTIME_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_LOCALTIME_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 (+4 -4) =================================================================== --- lib/str.c 2015-01-30 16:10:47 +0900 (5017533) +++ lib/str.c 2015-01-30 16:30:25 +0900 (c04feae) @@ -2441,11 +2441,11 @@ grn_text_time2rfc1123(grn_ctx *ctx, grn_obj *bulk, int sec) { time_t tsec; struct tm *t; -#ifdef HAVE__GMTIME_S +#ifdef HAVE_GMTIME_S struct tm tm; tsec = (time_t)sec; - t = (_gmtime_s(&tm, &tsec) == 0) ? &tm : NULL; -#else /* HAVE__GMTIME_S */ + t = (gmtime_s(&tm, &tsec) == 0) ? &tm : NULL; +#else /* HAVE_GMTIME_S */ # ifdef HAVE_GMTIME_R struct tm tm; tsec = (time_t)sec; @@ -2454,7 +2454,7 @@ grn_text_time2rfc1123(grn_ctx *ctx, grn_obj *bulk, int sec) tsec = (time_t)sec; t = gmtime(&tsec); # endif /* HAVE_GMTIME_R */ -#endif /* HAVE__GMTIME_S */ +#endif /* HAVE_GMTIME_S */ if (t) { GRN_TEXT_SET(ctx, bulk, weekdays[t->tm_wday], 3); GRN_TEXT_PUTS(ctx, bulk, ", "); -------------- next part -------------- HTML����������������������������...下載