[Groonga-commit] groonga/groonga [master] [solaris] Use localtime()

Back to archive index

null+****@clear***** null+****@clear*****
2012年 3月 4日 (日) 18:54:24 JST


Kouhei Sutou	2012-03-04 18:54:24 +0900 (Sun, 04 Mar 2012)

  New Revision: 0b7eb0378d35236f7db315f7362679bf45f7c50b

  Log:
    [solaris] Use localtime()

  Modified files:
    src/grntest.c

  Modified: src/grntest.c (+6 -6)
===================================================================
--- src/grntest.c    2012-03-04 18:50:23 +0900 (67bfbeb)
+++ src/grntest.c    2012-03-04 18:54:24 +0900 (0407b72)
@@ -2545,7 +2545,11 @@ get_username(char *name, int maxlen)
 static int
 get_date(char *date, time_t *sec)
 {
-#ifdef __GNUC__
+#ifdef WIN32
+  struct tm tmbuf;
+  struct tm *tm = &tmbuf;
+  localtime_s(tm, sec);
+#else /* WIN32 */
 #  ifdef HAVE_LOCALTIME_R
   struct tm result;
   struct tm *tm = &result;
@@ -2553,11 +2557,7 @@ get_date(char *date, time_t *sec)
 #  else /* HAVE_LOCALTIME_R */
   struct tm *tm = localtime(sec);
 #  endif /* HAVE_LOCALTIME_R */
-#else /* __GNUC__ */
-  struct tm tmbuf;
-  struct tm *tm = &tmbuf;
-  localtime_s(tm, sec);
-#endif /* __GNUC__ */
+#endif /* WIN32 */
 
 #ifdef WIN32
   strftime(date, 128, "%Y-%m-%d %H:%M:%S", tm);




Groonga-commit メーリングリストの案内
Back to archive index