[前][次][番号順一覧][スレッド一覧]

ruby-changes:29956

From: glass <ko1@a...>
Date: Tue, 16 Jul 2013 21:13:33 +0900 (JST)
Subject: [ruby-changes:29956] glass:r42008 (trunk): * configure.in: check strcasecmp().

glass	2013-07-16 21:13:19 +0900 (Tue, 16 Jul 2013)

  New Revision: 42008

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42008

  Log:
    * configure.in: check strcasecmp().
    
    * include/ruby/ruby.h: use strcasecmp() as st_strcasecmp() if it
      exists.
    
    * st.c (st_strcasecmp): define the function only if strcasecmp()
      doesn't exist.

  Modified files:
    trunk/ChangeLog
    trunk/configure.in
    trunk/include/ruby/ruby.h
    trunk/st.c

Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 42007)
+++ include/ruby/ruby.h	(revision 42008)
@@ -1808,7 +1808,11 @@ int rb_toupper(int c); https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1808
 #define TOUPPER(c) rb_toupper((unsigned char)(c))
 #define TOLOWER(c) rb_tolower((unsigned char)(c))
 
+#ifdef HAVE_STRCASECMP
+#define st_strcasecmp strcasecmp
+#else
 int st_strcasecmp(const char *s1, const char *s2);
+#endif
 int st_strncasecmp(const char *s1, const char *s2, size_t n);
 #define STRCASECMP(s1, s2) (st_strcasecmp((s1), (s2)))
 #define STRNCASECMP(s1, s2, n) (st_strncasecmp((s1), (s2), (n)))
Index: configure.in
===================================================================
--- configure.in	(revision 42007)
+++ configure.in	(revision 42008)
@@ -1823,6 +1823,7 @@ AC_CHECK_FUNCS(sigaltstack) https://github.com/ruby/ruby/blob/trunk/configure.in#L1823
 AC_CHECK_FUNCS(sigprocmask)
 AC_CHECK_FUNCS(sinh)
 AC_CHECK_FUNCS(spawnv)
+AC_CHECK_FUNCS(strcasecmp)
 AC_CHECK_FUNCS(symlink)
 AC_CHECK_FUNCS(syscall)
 AC_CHECK_FUNCS(sysconf)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42007)
+++ ChangeLog	(revision 42008)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jul 16 21:07:04 2013  Masaki Matsushita  <glass.saga@g...>
+
+	* configure.in: check strcasecmp().
+
+	* include/ruby/ruby.h: use strcasecmp() as st_strcasecmp() if it
+	  exists.
+
+	* st.c (st_strcasecmp): define the function only if strcasecmp()
+	  doesn't exist.
+
 Tue Jul 16 20:21:28 2013  Tanaka Akira  <akr@f...>
 
 	* bignum.c (bigsq): Renamed from bigsqr.
Index: st.c
===================================================================
--- st.c	(revision 42007)
+++ st.c	(revision 42008)
@@ -1524,6 +1524,7 @@ strhash(st_data_t arg) https://github.com/ruby/ruby/blob/trunk/st.c#L1524
 }
 #endif
 
+#ifndef HAVE_STRCASECMP
 int
 st_strcasecmp(const char *s1, const char *s2)
 {
@@ -1547,6 +1548,7 @@ st_strcasecmp(const char *s1, const char https://github.com/ruby/ruby/blob/trunk/st.c#L1548
         }
     }
 }
+#endif
 
 int
 st_strncasecmp(const char *s1, const char *s2, size_t n)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]