[Groonga-commit] groonga/groonga [master] windows: use _stricmp() as fallback of strncasecmp()

Back to archive index

null+****@clear***** null+****@clear*****
2012年 5月 17日 (木) 23:03:28 JST


Kouhei Sutou	2012-05-17 23:03:28 +0900 (Thu, 17 May 2012)

  New Revision: c3355100e3a8dbe5cccce4efc85cd91d0038505c

  Log:
    windows: use _stricmp() as fallback of strncasecmp()

  Modified files:
    build/ac_macros/check_functions.m4
    config.h.cmake
    plugins/suggest/suggest.c

  Modified: build/ac_macros/check_functions.m4 (+2 -0)
===================================================================
--- build/ac_macros/check_functions.m4    2012-05-17 22:57:45 +0900 (35f09c6)
+++ build/ac_macros/check_functions.m4    2012-05-17 23:03:28 +0900 (5046e8c)
@@ -1,5 +1,6 @@
 # -*- autoconf -*-
 
+AC_CHECK_FUNCS(_strnicmp)
 AC_CHECK_FUNCS(_strtoui64)
 AC_CHECK_FUNCS(close)
 AC_CHECK_FUNCS(gmtime_r)
@@ -7,5 +8,6 @@ AC_CHECK_FUNCS(localtime_r)
 AC_CHECK_FUNCS(mkostemp)
 AC_CHECK_FUNCS(open)
 AC_CHECK_FUNCS(read)
+AC_CHECK_FUNCS(strncasecmp)
 AC_CHECK_FUNCS(strtoull)
 AC_CHECK_FUNCS(write)

  Modified: config.h.cmake (+2 -0)
===================================================================
--- config.h.cmake    2012-05-17 22:57:45 +0900 (138c8a7)
+++ config.h.cmake    2012-05-17 23:03:28 +0900 (1344cfb)
@@ -118,6 +118,7 @@
 #cmakedefine HAVE_MECAB_DICTIONARY_INFO_T
 
 /* functions */
+#cmakedefine HAVE__STRICMP
 #cmakedefine HAVE__STRTOUI64
 #cmakedefine HAVE_BACKTRACE
 #cmakedefine HAVE_CLOCK
@@ -129,5 +130,6 @@
 #cmakedefine HAVE_MKOSTEMP
 #cmakedefine HAVE_OPEN
 #cmakedefine HAVE_READ
+#cmakedefine HAVE_STRNCASECMP
 #cmakedefine HAVE_STRTOULL
 #cmakedefine HAVE_WRITE

  Modified: plugins/suggest/suggest.c (+6 -0)
===================================================================
--- plugins/suggest/suggest.c    2012-05-17 22:57:45 +0900 (6bb95c2)
+++ plugins/suggest/suggest.c    2012-05-17 23:03:28 +0900 (c81e717)
@@ -23,6 +23,12 @@
 #include <groonga/plugin.h>
 #include <string.h>
 
+#ifndef HAVE_STRNCASECMP
+# ifdef HAVE__STRNICMP
+#  define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
+# endif /* HAVE__STRNICMP */
+#endif /* HAVE_STRNCASECMP */
+
 #define VAR GRN_PROC_GET_VAR_BY_OFFSET
 #define CONST_STR_LEN(x) x, x ? sizeof(x) - 1 : 0
 #define TEXT_VALUE_LEN(x) GRN_TEXT_VALUE(x), GRN_TEXT_LEN(x)




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