From 4ddce7a68bf974c124ed15cf364e0ea0eb1a5f15 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 24 Apr 2013 12:52:26 +0000 Subject: [PATCH] * configure.in: Check mblen(). * eval_intern.h (CharNext): Don't use mblen() is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ configure.in | 2 +- eval_intern.h | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7cfa5c2322..92d747dd21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Apr 24 21:51:13 2013 Tanaka Akira + + * configure.in: Check mblen(). + + * eval_intern.h (CharNext): Don't use mblen() is not available. + Wed Apr 24 15:55:06 2013 KOSAKI Motohiro * io.c (rb_fd_fix_cloexec): use rb_update_max_fd(). diff --git a/configure.in b/configure.in index 8fba7aa545..e0beb83a93 100644 --- a/configure.in +++ b/configure.in @@ -1701,7 +1701,7 @@ AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall __syscall chroot ge setuid setgid daemon select_large_fdset setenv unsetenv\ mktime timegm gmtime_r clock_gettime gettimeofday poll ppoll\ pread sendfile shutdown sigaltstack dl_iterate_phdr\ - dup dup3 pipe2 posix_memalign memalign ioctl) + dup dup3 pipe2 posix_memalign memalign ioctl mblen) AC_CACHE_CHECK(for sigsetjmp as a macro or function, ac_cv_func_sigsetjmp, [AC_TRY_COMPILE([ diff --git a/eval_intern.h b/eval_intern.h index 334b8d439a..190ef9195c 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -195,7 +195,11 @@ VALUE rb_vm_top_self(); VALUE rb_vm_cbase(void); #ifndef CharNext /* defined as CharNext[AW] on Windows. */ -#define CharNext(p) ((p) + mblen((p), RUBY_MBCHAR_MAXSIZE)) +# ifdef HAVE_MBLEN +# define CharNext(p) ((p) + mblen((p), RUBY_MBCHAR_MAXSIZE)) +# else +# define CharNext(p) ((p) + 1) +# endif #endif #if defined DOSISH || defined __CYGWIN__