/[pcre]/code/trunk/pcre_internal.h
ViewVC logotype

Diff of /code/trunk/pcre_internal.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 117 by ph10, Fri Mar 9 15:59:06 2007 UTC revision 118 by ph10, Fri Mar 9 16:17:46 2007 UTC
# Line 200  option on the command line. */ Line 200  option on the command line. */
200  /* 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(),
201  define a macro for memmove() if HAVE_MEMMOVE is false, provided that HAVE_BCOPY  define a macro for memmove() if HAVE_MEMMOVE is false, provided that HAVE_BCOPY
202  is set. Otherwise, include an emulating function for those systems that have  is set. Otherwise, include an emulating function for those systems that have
203  neither (there some non-Unix environments where this is the case). This assumes  neither (there some non-Unix environments where this is the case). */
 that all calls to memmove are moving strings upwards in store, which is the  
 case in PCRE. */  
204    
205  #if ! HAVE_MEMMOVE  #if ! HAVE_MEMMOVE
206  #undef  memmove        /* some systems may have a macro */  #undef  memmove        /* some systems may have a macro */
# Line 215  pcre_memmove(void *d, const void *s, siz Line 213  pcre_memmove(void *d, const void *s, siz
213  size_t i;  size_t i;
214  unsigned char *dest = (unsigned char *)d;  unsigned char *dest = (unsigned char *)d;
215  const unsigned char *src = (const unsigned char *)s;  const unsigned char *src = (const unsigned char *)s;
216  dest += n;  if (dest > src)
217  src += n;    {
218  for (i = 0; i < n; ++i) *(--dest) = *(--src);    dest += n;
219  return (void *)dest;    src += n;
220      for (i = 0; i < n; ++i) *(--dest) = *(--src);
221      return (void *)dest;
222      }
223    else
224      {
225      for (i = 0; i < n; ++i) *dest++ = *src++;
226      return (void *)(dest - n);
227      }
228  }  }
229  #define memmove(a, b, c) pcre_memmove(a, b, c)  #define memmove(a, b, c) pcre_memmove(a, b, c)
230  #endif   /* not HAVE_BCOPY */  #endif   /* not HAVE_BCOPY */

Legend:
Removed from v.117  
changed lines
  Added in v.118

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12