Kaydet (Commit) 41bc3089 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Let's rely on memmove() being sane on all our platforms

Defining an own memmove() here is silly. It breaks compilation against
MacOSX 10.6 SDK where memmove is a macro. If we really wanted to avoid
the system memmove() here, surely we should then use
rtl_moveMemory(). But since when is idlcpp performance critical?
üst 28cf0a3c
...@@ -212,40 +212,4 @@ void ...@@ -212,40 +212,4 @@ void
setsource(fp, -1, fd, NULL, 0); setsource(fp, -1, fd, NULL, 0);
} }
/* memmove is defined here because some vendors don't provide it at
all and others do a terrible job (like calling malloc) */
#if !defined(__IBMC__) && !defined(WNT) && !defined(__GLIBC__)
void *
memmove(void *dp, const void *sp, size_t n)
{
unsigned char *cdp, *csp;
if (n <= 0)
return 0;
cdp = dp;
csp = (unsigned char *) sp;
if (cdp < csp)
{
do
{
*cdp++ = *csp++;
} while (--n);
}
else
{
cdp += n;
csp += n;
do
{
*--cdp = *--csp;
} while (--n);
}
return 0;
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment