Added errno.c
[fw/sdcc] / device / lib / _memcpy.c
index aebbbb9cc39d16949d9b588b9820d8446d5b4c6d..38681c84e8598d673a676fa3aabcb30295478dab 100644 (file)
 
 #if !_SDCC_PORT_PROVIDES_MEMCPY
 
-#define NULL (void *)0
-
 void * memcpy (
        void * dst,
        void * src,
-       int acount
+       size_t acount
        ) 
 {
 #if _SDCC_Z80_STYLE_LIB_OPT
@@ -41,7 +39,7 @@ void * memcpy (
        char * d = dst;
        char * s = src;
        /* PENDING: Divide first to get around sign problems */
-       int count = -(acount/4);
+       int count = -(acount >> 2);
 
         while (count) {
                *d++ = *s++;