# HG changeset patch # User Rik # Date 1356549286 28800 # Node ID ffd1a99733bd17845fdff98733f7d0790f2c0c83 # Parent e55a64f49346e73e5b67e6f7cb3b0e9a5cc35efa build: Check for isascii() before using it. * configure.ac: Add AC_CHECK_FUNCS line for isascii. * libinterp/octave-value/ov-ch-mat.cc(xisascii): test HAVE_ISASCII before using isascii(). diff -r e55a64f49346 -r ffd1a99733bd configure.ac --- a/configure.ac Tue Dec 25 22:15:02 2012 +0100 +++ b/configure.ac Wed Dec 26 11:14:46 2012 -0800 @@ -1941,7 +1941,8 @@ AC_CHECK_FUNCS([endgrent endpwent execvp expm1 expm1f fork]) AC_CHECK_FUNCS([getegid geteuid getgid getgrent getgrgid getgrnam]) AC_CHECK_FUNCS([getpgrp getpid getppid getpwent getpwuid getuid]) -AC_CHECK_FUNCS([kill lgamma lgammaf lgamma_r lgammaf_r]) +AC_CHECK_FUNCS([isascii kill]) +AC_CHECK_FUNCS([lgamma lgammaf lgamma_r lgammaf_r]) AC_CHECK_FUNCS([log1p log1pf pipe]) AC_CHECK_FUNCS([realpath resolvepath roundl]) AC_CHECK_FUNCS([select setgrent setpwent siglongjmp strsignal]) diff -r e55a64f49346 -r ffd1a99733bd libinterp/octave-value/ov-ch-mat.cc --- a/libinterp/octave-value/ov-ch-mat.cc Tue Dec 25 22:15:02 2012 +0100 +++ b/libinterp/octave-value/ov-ch-mat.cc Wed Dec 26 11:14:46 2012 -0800 @@ -154,11 +154,17 @@ // The C++ standard guarantees cctype defines functions, not macros (and // hence macros *CAN'T* be defined if only cctype is included) so -// there's no need to fuck around. The exceptions are isascii and -// toascii, which are not C++. Oddly enough, all those character -// functions are int (*) (int), even in C++. Wicked! +// there's no need to fuck around. The exceptions are isascii and +// toascii, which are not C++. Oddly enough, all those character +// functions are int (*) (int), even in C++. Wicked! static inline int xisascii (int c) -{ return isascii (c); } +{ +#ifdef HAVE_ISASCII + return isascii (c); +#else + return (c >= 0x00 && c <= 0x7f); +#endif +} static inline int xtoascii (int c) {