4 * Copyright 1998-2002 The OpenLDAP Foundation, Redwood City, California, USA
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
9 * Public License. A copy of this license is available at
10 * http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 * top-level directory of the distribution.
35 # define strrchr rindex
40 # define memcpy(d, s, n) ((void) bcopy ((s), (d), (n)))
42 # define memmove(d, s, n) ((void) bcopy ((s), (d), (n)))
46 /* use ldap_pvt_strtok instead of strtok or strtok_r! */
47 LDAP_F(char *) ldap_pvt_strtok LDAP_P(( char *str,
48 const char *delim, char **pos ));
51 /* strdup() is missing, declare our own version */
53 # define strdup(s) ber_strdup(s)
54 #elif !defined(_WIN32)
55 /* some systems fail to declare strdup */
56 /* Windows does not require this declaration */
57 LDAP_LIBC_F(char *) (strdup)();
61 * some systems fail to declare strcasecmp() and strncasecmp()
62 * we need them declared so we can obtain pointers to them
65 /* we don't want these declared for Windows or Mingw */
72 # if defined( HAVE_MEMMOVE )
73 # define SAFEMEMCPY( d, s, n ) memmove((d), (s), (n))
74 # elif defined( HAVE_BCOPY )
75 # define SAFEMEMCPY( d, s, n ) bcopy((s), (d), (n))
77 /* nothing left but memcpy() */
78 # define SAFEMEMCPY( d, s, n ) memcpy((d), (s), (n))
82 #define AC_MEMCPY( d, s, n ) (SAFEMEMCPY((d),(s),(n)))
83 #define AC_FMEMCPY( d, s, n ) do { \
84 if((n) == 1) *((char*)(d)) = *((char*)(s)); \
85 else AC_MEMCPY( (d), (s), (n) ); \
88 #endif /* _AC_STRING_H */