# HG changeset patch # User jwe # Date 850152640 0 # Node ID cfa9f35fd40795a202070f8cc0d0a5c23e3fb5cc # Parent 2799980db7205cdbde708290fe02decf3a3ad6ca [project @ 1996-12-09 17:30:39 by jwe] diff --git a/acconfig.h b/acconfig.h --- a/acconfig.h +++ b/acconfig.h @@ -60,6 +60,9 @@ /* Define if signal handlers must be reinstalled after they are called. */ #undef MUST_REINSTALL_SIGHANDLERS +/* Define (to string::npos) if doesn't. */ +#undef NPOS + /* Define if you don't have NPSOL. */ #undef NPSOL_MISSING diff --git a/aclocal.m4 b/aclocal.m4 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -369,6 +369,22 @@ fi ]) dnl +dnl See if the standard string class has npos as a member. +dnl +AC_DEFUN(OCTAVE_STRING_NPOS, +[AC_CACHE_CHECK([whether including defines NPOS], +octave_cv_string_npos, +[AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE([#include ], +[size_t foo = NPOS], +octave_cv_string_npos=yes, octave_cv_string_npos=no)]) +if test $octave_cv_string_npos = no; then + AC_DEFINE(NPOS, string::npos) +fi +AC_LANG_RESTORE +]) +dnl dnl The following test is from Karl Berry's Kpathseach library. I'm dnl including it here in case we someday want to make the use of dnl kpathsea optional. diff --git a/config.h.bot b/config.h.bot --- a/config.h.bot +++ b/config.h.bot @@ -7,12 +7,6 @@ #define GCC_ATTR_UNUSED #endif -#if defined (__GNUC__) -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7) -#define NPOS string::npos -#endif -#endif - #define STATIC_CAST(T, E) (T) (E) #define DYNAMIC_CAST(T, E) (T) (E) diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -21,7 +21,7 @@ ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA ### 02111-1307, USA. -AC_REVISION($Revision: 1.238 $) +AC_REVISION($Revision: 1.239 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -458,6 +458,10 @@ OCTAVE_CXXLIBS +### See if we should define NPOS. + +OCTAVE_STRING_NPOS + ### We need these before trying to find libf2c. if test -z "$AR"; then