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.
24 # if defined(HAVE_STRINGS_H) && (!defined(HAVE_STRING_H) ||
25 defined(BOTH_STRINGS_H))
37 # define strrchr rindex
42 # define memcpy(d, s, n) ((void) bcopy ((s), (d), (n)))
44 # define memmove(d, s, n) ((void) bcopy ((s), (d), (n)))
48 /* use ldap_pvt_strtok instead of strtok or strtok_r! */
49 LDAP_F(char *) ldap_pvt_strtok LDAP_P(( char *str,
50 const char *delim, char **pos ));
53 /* strdup() is missing, declare our own version */
55 # define strdup(s) ber_strdup(s)
56 #elif !defined(_WIN32)
57 /* some systems fail to declare strdup */
58 /* Windows does not require this declaration */
59 LDAP_LIBC_F(char *) (strdup)();
63 * some systems fail to declare strcasecmp() and strncasecmp()
64 * we need them declared so we can obtain pointers to them
67 /* we don't want these declared for Windows or Mingw */
74 # if defined( HAVE_MEMMOVE )
75 # define SAFEMEMCPY( d, s, n ) memmove((d), (s), (n))
76 # elif defined( HAVE_BCOPY )
77 # define SAFEMEMCPY( d, s, n ) bcopy((s), (d), (n))
79 /* nothing left but memcpy() */
80 # define SAFEMEMCPY( d, s, n ) memcpy((d), (s), (n))
84 #define AC_MEMCPY( d, s, n ) (SAFEMEMCPY((d),(s),(n)))
85 #define AC_FMEMCPY( d, s, n ) do { \
86 if((n) == 1) *((char*)(d)) = *((char*)(s)); \
87 else AC_MEMCPY( (d), (s), (n) ); \
90 #endif /* _AC_STRING_H */