* as/link/lkar.h: sgetl and sputl are independent of endianness
[fw/sdcc] / device / lib / _memcpy.c
index aebbbb9cc39d16949d9b588b9820d8446d5b4c6d..540c2cf296e9f6ff51b84b5ea3de2dc4c65aaa8c 100644 (file)
 
 #if !_SDCC_PORT_PROVIDES_MEMCPY
 
-#define NULL (void *)0
+#undef memcpy /* Avoid conflict with builtin memcpy() in Z80 port */
 
 void * memcpy (
        void * dst,
        void * src,
-       int acount
+       size_t acount
        ) 
 {
 #if _SDCC_Z80_STYLE_LIB_OPT
 
-#pragma NOINDUCTION
+#pragma noinduction
 
        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++;