]> git.sur5r.net Git - openldap/blobdiff - include/ac/string.h
Unexpand spaces for tabs in prior commit before merging to rel_eng_1_1.
[openldap] / include / ac / string.h
index 19efea1b780ea8397f0c987af664e0343f8e5929..6a64074e6fa8623f69b6726897825767398ca3a4 100644 (file)
 #              include <memory.h>
 #      endif
 
+       /* we should actually create <ac/stdlib.h> */
 #      ifdef HAVE_MALLOC_H
 #              include <malloc.h>
 #      endif
 
-#      ifndef HAVE_STRCHR
+#      ifndef HAVE_STRRCHR
 #              define strchr index
 #              define strrchr rindex
 #      endif
 
 #      ifndef HAVE_MEMCPY
-#              define memcpy(d, s, n)                  bcopy ((s), (d), (n))
-#              define memmove(d, s, n)                 bcopy ((s), (d), (n))
+#              define memcpy(d, s, n)          ((void) bcopy ((s), (d), (n)))
+#              define memmove(d, s, n)         ((void) bcopy ((s), (d), (n)))
 #      endif
 #endif
 
-/*
- * provide prototypes for missing functions that we replace.
- * replacements can be found in -llutil
- */
 #ifndef HAVE_STRDUP
-       char *strdup( const char *s );
+       /* strdup() is missing, declare our own version */
+       extern char *strdup( const char *s );
+#else
+       /* some systems have strdup, but fail to declare it */
+       extern char *strdup();
 #endif
 
+/*
+ * some systems fail to declare strcasecmp() and strncasecmp()
+ * we need them declared so we can obtain pointers to them
+ */
+extern int strcasecmp(), strncasecmp();
+
 #ifndef SAFEMEMCPY
 #      if defined( HAVE_MEMMOVE )
 #              define SAFEMEMCPY( d, s, n )    memmove((d), (s), (n))
@@ -51,4 +58,5 @@
 #      endif
 #endif
 
+
 #endif /* _AC_STRING_H */