-void *ch_malloc LDAP_P((unsigned long size));
-void *ch_realloc LDAP_P((void *block, unsigned long size));
-void *ch_calloc LDAP_P((unsigned long nelem, unsigned long size));
+#ifdef CSRIMALLOC
+#define ch_malloc malloc
+#define ch_realloc realloc
+#define ch_calloc calloc
+#define ch_free free
+#else
+void *ch_malloc LDAP_P((ber_len_t size));
+void *ch_realloc LDAP_P((void *block, ber_len_t size));
+void *ch_calloc LDAP_P((ber_len_t nelem, ber_len_t size));