diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2018-10-01 12:24:08 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2019-01-22 14:11:18 +0000 |
commit | 159f7e9c39c57177d25f524ae3cad4e533b89da8 (patch) | |
tree | 4137f7a27464b2f9572f3dab899786ec01c8656f /src/3rdparty/pcre2/src/pcre2_string_utils.c | |
parent | 94aa7dabd234981ebc5893e1b8154ac990ccbe44 (diff) |
Upgrade PCRE2 to 10.32
Squashed cherry pick of:
e39a9de3309f84be4101da839a0bacf69090706f
a7bcd16c750fb2ed36522719237af8ce3be94fa2
3bac18da8ef9f5750207ddf47192b5db3137c4ac
44eeeb8e816fbdcd77ad734cfe7a7ec28da1c5ed
[ChangeLog][Third-Party Code] PCRE2 was updated to version 10.32.
Change-Id: Id3bf7df0003f626cd1135d0508a5a489ff02f1e5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/3rdparty/pcre2/src/pcre2_string_utils.c')
-rw-r--r-- | src/3rdparty/pcre2/src/pcre2_string_utils.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/3rdparty/pcre2/src/pcre2_string_utils.c b/src/3rdparty/pcre2/src/pcre2_string_utils.c index 2a1f282629..d6be01acf5 100644 --- a/src/3rdparty/pcre2/src/pcre2_string_utils.c +++ b/src/3rdparty/pcre2/src/pcre2_string_utils.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -51,6 +51,42 @@ functions work only on 8-bit data. */ /************************************************* +* Emulated memmove() for systems without it * +*************************************************/ + +/* This function can make use of bcopy() if it is available. Otherwise do it by +steam, as there some non-Unix environments that lack both memmove() and +bcopy(). */ + +#if !defined(VPCOMPAT) && !defined(HAVE_MEMMOVE) +void * +PRIV(memmove)(void *d, const void *s, size_t n) +{ +#ifdef HAVE_BCOPY +bcopy(s, d, n); +return d; +#else +size_t i; +unsigned char *dest = (unsigned char *)d; +const unsigned char *src = (const unsigned char *)s; +if (dest > src) + { + dest += n; + src += n; + for (i = 0; i < n; ++i) *(--dest) = *(--src); + return (void *)dest; + } +else + { + for (i = 0; i < n; ++i) *dest++ = *src++; + return (void *)(dest - n); + } +#endif /* not HAVE_BCOPY */ +} +#endif /* not VPCOMPAT && not HAVE_MEMMOVE */ + + +/************************************************* * Compare two zero-terminated PCRE2 strings * *************************************************/ |