]> git.sur5r.net Git - openldap/blobdiff - include/ac/string.h
tavl_delete: copy balance factor
[openldap] / include / ac / string.h
index 764dfc448474529eca9a60f10a2bb6c12423720e..c35605ae080b523cc7f4b1eacef123204ac9e076 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -89,4 +89,24 @@ int (strncasecmp)();
                else AC_MEMCPY( (d), (s), (n) ); \
        } while(0)
 
+#ifdef NEED_MEMCMP_REPLACEMENT
+       int (lutil_memcmp)(const void *b1, const void *b2, size_t len);
+#define memcmp lutil_memcmp
+#endif
+
+#define STRLENOF(s)    (sizeof(s)-1)
+
+#if defined( HAVE_NONPOSIX_STRERROR_R )
+#      define AC_STRERROR_R(e,b,l)             (strerror_r((e), (b), (l)))
+#elif defined( HAVE_STRERROR_R )
+#      define AC_STRERROR_R(e,b,l)             (strerror_r((e), (b), (l)) ? (b) : NULL)
+#elif defined( HAVE_SYS_ERRLIST )
+#      define AC_STRERROR_R(e,b,l)             ((e) > -1 && (e) < sys_nerr \
+                                                                               ? sys_errlist[(e)] : NULL )
+#elif defined( HAVE_STRERROR )
+#      define AC_STRERROR_R(e,b,l)             (strerror(e))
+#else
+#      define AC_STRERROR_R(e,b,l)             (NULL)
+#endif
+
 #endif /* _AC_STRING_H */