diff options
author | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-16 12:13:19 +0000 |
---|---|---|
committer | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-16 12:13:19 +0000 |
commit | a0d9bd444530984a0a10fe6ca73cf9467ba843d2 (patch) | |
tree | 9d42f86c5a4f0350e0f3d391d35f9e7ea970f212 | |
parent | 6be7c95734cd0fea632bf33039c9fa3c0e0ebecc (diff) | |
download | ruby-a0d9bd444530984a0a10fe6ca73cf9467ba843d2.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | configure.in | 1 | ||||
-rw-r--r-- | include/ruby/ruby.h | 4 | ||||
-rw-r--r-- | st.c | 2 |
4 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,13 @@ +Tue Jul 16 21:07:04 2013 Masaki Matsushita <glass.saga@gmail.com> + + * 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@fsij.org> * bignum.c (bigsq): Renamed from bigsqr. diff --git a/configure.in b/configure.in index 48184e23cf..e19f7209f4 100644 --- a/configure.in +++ b/configure.in @@ -1823,6 +1823,7 @@ AC_CHECK_FUNCS(sigaltstack) 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) diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 2fd5981a67..df89b387dd 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1808,7 +1808,11 @@ int rb_toupper(int c); #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))) @@ -1524,6 +1524,7 @@ strhash(st_data_t arg) } #endif +#ifndef HAVE_STRCASECMP int st_strcasecmp(const char *s1, const char *s2) { @@ -1547,6 +1548,7 @@ st_strcasecmp(const char *s1, const char *s2) } } } +#endif int st_strncasecmp(const char *s1, const char *s2, size_t n) |