This is required for SunOS 4.1.4 aka Solaris 1.1.
Thanks to Götz Hoffart for testing!
# -- Libraries --
-# memmove: A/UX libUTIL
-AC_SEARCH_LIBS([memmove], [UTIL], [], [
- AC_MSG_ERROR([unable to find the memmove() function])
-])
+# memmove: A/UX libUTIL; but we can use our own implementation.
+AC_SEARCH_LIBS([memmove], [UTIL])
# gethostbyname: Solaris libnsl
AC_SEARCH_LIBS([gethostbyname], [bind nsl network], [], [
AC_MSG_ERROR([unable to find the gethostbyname() function])
gethostname \
gettimeofday \
inet_ntoa \
- memmove \
memset \
setsid \
socket \
gai_strerror \
getnameinfo \
inet_aton \
+ memmove \
setgroups \
sigaction \
sigprocmask \
noinst_LIBRARIES = libngportab.a
libngportab_a_SOURCES = \
+ memmove.c \
strdup.c \
strlcpy.c \
strndup.c \
--- /dev/null
+/*
+ * ngIRCd -- The Next Generation IRC Daemon
+ */
+
+#include "portab.h"
+
+/**
+ * @file
+ * memmove() implementation.
+ * Source: http://c-faq.com/~scs/cgi-bin/faqcat.cgi?sec=ansi
+ */
+
+#ifndef HAVE_MEMMOVE
+
+GLOBAL void *
+memmove(void *dest, void const *src, size_t n)
+{
+ register char *dp = dest;
+ register char const *sp = src;
+ if(dp < sp) {
+ while(n-- > 0)
+ *dp++ = *sp++;
+ } else {
+ dp += n;
+ sp += n;
+ while(n-- > 0)
+ *--dp = *--sp;
+ }
+
+ return dest;
+}
+
+#endif