]> git.sur5r.net Git - openldap/commitdiff
Add AC_MEMCPY and AC_FAST_MEMCPY macros to eventually replace
authorKurt Zeilenga <kurt@openldap.org>
Thu, 27 Jul 2000 20:10:44 +0000 (20:10 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 27 Jul 2000 20:10:44 +0000 (20:10 +0000)
SAFEMEMCPY.  AC_FAST_MEMCPY has a len==1 optimization for use
in -llber.

include/ac/string.h

index bac0dc256e995eec8fe2a2f5af681bc3dd849094..c5471e158379479d4f3e16f9d7095438061fe53c 100644 (file)
@@ -75,4 +75,10 @@ int (strncasecmp)();
 #      endif
 #endif
 
+#define AC_MEMCPY( d, s, n ) (SAFEMEMCPY((d),(s),(n)))
+#define AC_FMEMCPY( d, s, n ) do { \
+               if((n) == 1) *((char*)(d)) = *((char*)(s)); \
+               else AC_MEMCPY( (d), (s), (n) ); \
+       } while(0)
+
 #endif /* _AC_STRING_H */