]> git.sur5r.net Git - openldap/blob - include/ac/string.h
Found the really, really stupid bug. The SAFEMEMCPY macro
[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 #ifndef SAFEMEMCPY
22 #       if defined( HAVE_MEMMOVE )
23 #               define SAFEMEMCPY( d, s, n )    memmove((d), (s), (n))
24 #       elif defined( HAVE_BCOPY )
25 #               define SAFEMEMCPY( d, s, n )    bcopy((s), (d), (n))
26 #       elif defined( MACOS )
27 #               define SAFEMEMCPY( d, s, n )    BlockMoveData((Ptr)(s), (Ptr)(d), (n))
28 #       else
29                 /* nothing left but memcpy() */
30 #               define SAFEMEMCPY( d, s, n )    memcpy((d), (s), (n))
31 #       endif
32 #endif
33
34 #endif /* _AC_STRING_H */