[Groonga-commit] groonga/groonga [master] windows: use locatime_s() only for MSVC

Back to archive index

null+****@clear***** null+****@clear*****
2012年 3月 29日 (木) 07:25:24 JST


Kouhei Sutou	2012-03-29 07:25:24 +0900 (Thu, 29 Mar 2012)

  New Revision: 5ef25657b51a5363201880c855cf477c238341bb

  Log:
    windows: use locatime_s() only for MSVC

  Modified files:
    src/groonga_benchmark.c

  Modified: src/groonga_benchmark.c (+3 -3)
===================================================================
--- src/groonga_benchmark.c    2012-03-29 01:26:23 +0900 (beef9b8)
+++ src/groonga_benchmark.c    2012-03-29 07:25:24 +0900 (b4bff19)
@@ -2545,11 +2545,11 @@ get_username(char *name, int maxlen)
 static int
 get_date(char *date, time_t *sec)
 {
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
   struct tm tmbuf;
   struct tm *tm = &tmbuf;
   localtime_s(tm, sec);
-#else /* WIN32 */
+#else /* defined(WIN32) && !defined(__GNUC__) */
 #  ifdef HAVE_LOCALTIME_R
   struct tm result;
   struct tm *tm = &result;
@@ -2557,7 +2557,7 @@ get_date(char *date, time_t *sec)
 #  else /* HAVE_LOCALTIME_R */
   struct tm *tm = localtime(sec);
 #  endif /* HAVE_LOCALTIME_R */
-#endif /* WIN32 */
+#endif /* defined(WIN32) && !defined(__GNUC__) */
 
 #ifdef WIN32
   strftime(date, 128, "%Y-%m-%d %H:%M:%S", tm);




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