dnl
AC_CHECK_FUNC(vasprintf, AC_DEFINE([HAVE_VASPRINTF]))
AC_CHECK_FUNC(asprintf, AC_DEFINE([HAVE_ASPRINTF]))
+AC_CHECK_FUNC(strcasestr, AC_DEFINE([HAVE_STRCASESTR]))
AC_FUNC_FSEEKO()
dnl
/* Utilities */
extern char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int truncdirection);
+#ifndef HAVE_STRCASESTR
+extern char *strcasestr(const char *s, const char *find);
+#endif
/*******************************************************************************
* SQLMM internal functions - TODO: Move into separate header files
return newsrid;
}
+
+#ifndef HAVE_STRCASESTR
+char *strcasestr(const char *s, const char *find)
+{
+ char c, sc;
+ size_t len;
+
+ if ((c = *find++) != 0) {
+ c = tolower((unsigned char)c);
+ len = strlen(find);
+ do {
+ do {
+ if ((sc = *s++) == 0)
+ return (NULL);
+ } while ((char)tolower((unsigned char)sc) != c);
+ } while (strncasecmp(s, find, len) != 0);
+ s--;
+ }
+ return ((char *)s);
+}
+#endif
#undef HAVE_ISFINITE
#undef HAVE_GNU_ISFINITE
#undef HAVE_FSEEKO
+#undef HAVE_STRCASESTR
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H