[Groonga-mysql-commit] mroonga/mroonga [master] win32: use gmtime_s instead of gmtime_r

アーカイブの一覧に戻る

HAYASHI Kentaro null+****@clear*****
Fri Oct 12 16:36:37 JST 2012


HAYASHI Kentaro	2012-10-12 16:36:37 +0900 (Fri, 12 Oct 2012)

  New Revision: 68e0185de6ebe1387bb5dd3df0bbeedfc6e5255e
  https://github.com/mroonga/mroonga/commit/68e0185de6ebe1387bb5dd3df0bbeedfc6e5255e

  Log:
    win32: use gmtime_s instead of gmtime_r
    
    TODO: use better workaroud for avoiding segmentation fault.
    This is temporary fix for investigating further win32 related issues.

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+5 -0)
===================================================================
--- ha_mroonga.cpp    2012-10-11 18:51:10 +0900 (46dd236)
+++ ha_mroonga.cpp    2012-10-12 16:36:37 +0900 (9e99a92)
@@ -41,6 +41,7 @@
 #ifdef WIN32
 #  include <math.h>
 #  include <direct.h>
+#  include <time.h>
 #  define MRN_MKDIR(pathname, mode) _mkdir((pathname))
 #  define MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(type, variable_name, variable_size) \
     type *variable_name = (type *)_malloca(sizeof(type) * variable_size)
@@ -1620,7 +1621,11 @@ static void mrn_init_time(void)
   struct tm now_tm;
   time_t now;
   time(&now);
+#ifdef _MSC_VER
+  gmtime_s(&now_tm, &now);
+#else
   gmtime_r(&now, &now_tm);
+#endif
   mrn_utc_diff_in_seconds = now - mktime(&now_tm);
 }
 
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-mysql-commit mailing list
アーカイブの一覧に戻る