]> git.sur5r.net Git - openldap/blob - include/ac/string.h
We're assuming STDC all the way.
[openldap] / include / ac / string.h
1 /* Generic string.h */
2
3 #ifndef _AC_STRING_H
4 #define _AC_STRING_H
5
6 #ifdef STDC_HEADERS
7 #       include <string.h>
8 #else
9 #       ifndef HAVE_STRCHR
10 #               define strchr index
11 #               define strrchr rindex
12 #       endif
13         char *strchr (), *strrchr ();
14
15 #       ifndef HAVE_MEMCPY
16 #               define memcpy(d, s, n) bcopy ((s), (d), (n))
17 #               define memmove(d, s, n) bcopy ((s), (d), (n))
18 #       endif
19 #endif
20
21 #if defined( HAVE_MEMMOVE )
22 #define SAFEMEMCPY( d, s, n )                   memmove((s), (d), (n))
23 #elif defined( HAVE_BCOPY )
24 #define SAFEMEMCPY( d, s, n )           bcopy((s), (d), (n))
25 #elif defined( MACOS )
26 #define SAFEMEMCPY( d, s, n )   BlockMoveData((Ptr)(s), (Ptr)(d), (n))
27 #else
28 /* nothing left but memcpy() */
29 #define SAFEMEMCPY( d, s, n )   memcpy((s), (d), (n))
30 #endif
31
32 #endif /* _AC_STRING_H */