]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix dhat/tests/copy on Solaris
authorPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 8 Dec 2020 20:29:43 +0000 (21:29 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 8 Dec 2020 20:29:43 +0000 (21:29 +0100)
dhat/tests/copy.c
shared/vg_replace_strmem.c

index 8e6b7def4bae50916dd34e941ce396b21f8b1c01..dd94ec19f81ad557dcc757c5c36e9a42c0e7cc46 100644 (file)
@@ -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);
index ca1c7ea742583104c9bef2592ae14c4b7704a40e..aaa29940aacbb620db06e1a15fe2c3fd9b44d445 100644 (file)
@@ -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