40 |
#include "config.h" |
#include "config.h" |
41 |
|
|
42 |
/* To cope with SunOS4 and other systems that lack memmove() but have bcopy(), |
/* To cope with SunOS4 and other systems that lack memmove() but have bcopy(), |
43 |
define a macro for memmove() if HAVE_MEMMOVE is false. */ |
define a macro for memmove() if HAVE_MEMMOVE is false, provided that HAVE_BCOPY |
44 |
|
is set. Otherwise, include an emulating function for those systems that have |
45 |
|
neither (there some non-Unix environments where this is the case). This assumes |
46 |
|
that all calls to memmove are moving strings upwards in store, which is the |
47 |
|
case in PCRE. */ |
48 |
|
|
49 |
#if ! HAVE_MEMMOVE |
#if ! HAVE_MEMMOVE |
50 |
#undef memmove /* some systems may have a macro */ |
#undef memmove /* some systems may have a macro */ |
51 |
|
#if HAVE_BCOPY |
52 |
#define memmove(a, b, c) bcopy(b, a, c) |
#define memmove(a, b, c) bcopy(b, a, c) |
53 |
|
#else |
54 |
|
void * |
55 |
|
pcre_memmove(unsigned char *dest, const unsigned char *src, size_t n) |
56 |
|
{ |
57 |
|
int i; |
58 |
|
dest += n; |
59 |
|
src += n; |
60 |
|
for (i = 0; i < n; ++i) *(--dest) = *(--src); |
61 |
|
} |
62 |
|
#define memmove(a, b, c) pcre_memmove(a, b, c) |
63 |
|
#endif |
64 |
#endif |
#endif |
65 |
|
|
66 |
/* Standard C headers plus the external interface definition */ |
/* Standard C headers plus the external interface definition */ |