|
From: Paul F. <pa...@so...> - 2020-12-08 20:33:30
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a86016fc2258753de562d93d62169b8960c88b4b commit a86016fc2258753de562d93d62169b8960c88b4b Author: Paul Floyd <pj...@wa...> Date: Tue Dec 8 21:29:43 2020 +0100 Fix dhat/tests/copy on Solaris Diff: --- dhat/tests/copy.c | 14 ++++++++++---- shared/vg_replace_strmem.c | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dhat/tests/copy.c b/dhat/tests/copy.c index 8e6b7def4b..dd94ec19f8 100644 --- a/dhat/tests/copy.c +++ b/dhat/tests/copy.c @@ -4,6 +4,8 @@ #include <stdlib.h> #include <string.h> #include <wchar.h> +#include <strings.h> +#include "../../config.h" void f(char* a, char* b, wchar_t* wa, wchar_t* wb); void test_malloc(); @@ -21,11 +23,11 @@ int main(void) { wchar_t wa[250]; wchar_t wb[250]; for (int i = 0; i < 250; i++) { - wa[i] = 'A'; - wb[i] = 'B'; + wa[i] = L'A'; + wb[i] = L'B'; } - wa[249] = '\0'; - wb[249] = '\0'; + wa[249] = L'\0'; + wb[249] = L'\0'; for (int i = 0; i < 100; i++) { f(a, b, wa, wb); @@ -41,7 +43,11 @@ void f(char* a, char* b, wchar_t* wa, wchar_t* wb) { memcpy (a, b, 1000); // Redirects to memmove memcpy (a, b, 1000); // Redirects to memmove memmove(a, b, 1000); +#if defined(VGO_solaris) + memcpy(a, b, 1000); +#else mempcpy(a, b, 1000); +#endif bcopy (a, b, 1000); // Redirects to memmove strcpy (a, b); strncpy(a, b, 1000); diff --git a/shared/vg_replace_strmem.c b/shared/vg_replace_strmem.c index ca1c7ea742..aaa29940aa 100644 --- a/shared/vg_replace_strmem.c +++ b/shared/vg_replace_strmem.c @@ -2014,7 +2014,7 @@ static inline void my_exit ( int x ) return dst_orig; \ } -#if defined(VGO_linux) +#if defined(VGO_linux) || defined(VGO_solaris) WCSCPY(VG_Z_LIBC_SONAME, wcscpy) #endif |