[Groonga-commit] groonga/groonga at 5ba0483 [master] mingw: force to use 64bit version to work with debug build

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Mar 24 21:59:07 JST 2015


Kouhei Sutou	2015-03-24 21:59:07 +0900 (Tue, 24 Mar 2015)

  New Revision: 5ba0483347c474d1c0a44762091d4993b35130f6
  https://github.com/groonga/groonga/commit/5ba0483347c474d1c0a44762091d4993b35130f6

  Message:
    mingw: force to use 64bit version to work with debug build
    
    localtime_s() and gmtime_s() are defined as inline function without
    static in MinGW. The inline functions aren't inlined with -O0 build.
    So localtime_s() and gmtime_s() symbols aren't found:
    
        .libs/ctx.o: In function `grn_timeval2tm':
        lib/ctx.c:141: undefined reference to `localtime_s'
        .libs/str.o: In function `grn_text_time2rfc1123':
        lib/str.c:2447: undefined reference to `gmtime_s'
        collect2: error: ld returned 1 exit status

  Modified files:
    lib/ctx.c
    lib/str.c

  Modified: lib/ctx.c (+5 -1)
===================================================================
--- lib/ctx.c    2015-03-24 17:56:09 +0900 (70af1fc)
+++ lib/ctx.c    2015-03-24 21:59:07 +0900 (c4829fd)
@@ -27,14 +27,18 @@
 #include "grn_output.h"
 #include "grn_normalizer.h"
 #include "grn_ctx_impl_mrb.h"
+#include "grn_logger.h"
 #include <stdio.h>
 #include <stdarg.h>
 #include <time.h>
-#include <sys/stat.h>
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif /* HAVE_NETINET_IN_H */
 
+#if defined(HAVE__LOCALTIME64_S) && defined(__GNUC__)
+# define localtime_s(tm, time) _localtime64_s(tm, time)
+#endif /* defined(HAVE__GMTIME64_S) && defined(__GNUC__) */
+
 #define GRN_CTX_INITIALIZER(enc) \
   { GRN_SUCCESS, 0, enc, 0, GRN_LOG_NOTICE,\
     GRN_CTX_FIN, 0, 0, 0, 0, {0}, NULL, NULL, NULL, NULL, NULL }

  Modified: lib/str.c (+4 -0)
===================================================================
--- lib/str.c    2015-03-24 17:56:09 +0900 (f91b89c)
+++ lib/str.c    2015-03-24 21:59:07 +0900 (00e4418)
@@ -27,6 +27,10 @@
 #endif /* _ISOC99_SOURCE */
 #include <math.h>
 
+#if defined(HAVE__GMTIME64_S) && defined(__GNUC__)
+# define gmtime_s(tm, time) _gmtime64_s(tm, time)
+#endif /* defined(HAVE__GMTIME64_S) && defined(__GNUC__) */
+
 /* For Visual C++ 2010. Drop the code when we drop Visual C++ 2010 support. */
 #if defined(_MSC_VER) && _MSC_VER < 1800
 # define va_copy(destination, source) destination = source
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index