From: Kurt Zeilenga Date: Thu, 27 Jul 2000 20:10:44 +0000 (+0000) Subject: Add AC_MEMCPY and AC_FAST_MEMCPY macros to eventually replace X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2339 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=db060d8753ac7fd15adcbb630f08aabd9e4d4cae;p=openldap Add AC_MEMCPY and AC_FAST_MEMCPY macros to eventually replace SAFEMEMCPY. AC_FAST_MEMCPY has a len==1 optimization for use in -llber. --- diff --git a/include/ac/string.h b/include/ac/string.h index bac0dc256e..c5471e1583 100644 --- a/include/ac/string.h +++ b/include/ac/string.h @@ -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 */