]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - string/test-stpcpy.c
nptl: Move pthread_attr_setinheritsched implementation into libc.
[thirdparty/glibc.git] / string / test-stpcpy.c
index 6c3d28c35f1046d33c90f6e5714f7fb92cc35a0e..e460bb8da5c3328fce7ec6c2d3ffe6f1823db3c1 100644 (file)
@@ -1,5 +1,5 @@
-/* Test and measure stpcpy functions.
-   Copyright (C) 1999-2014 Free Software Foundation, Inc.
+/* Test stpcpy functions.
+   Copyright (C) 1999-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #define STRCPY_RESULT(dst, len) ((dst) + (len))
 #define TEST_MAIN
-#define TEST_NAME "stpcpy"
+#ifndef WIDE
+# define TEST_NAME "stpcpy"
+#else
+# define TEST_NAME "wcpcpy"
+#endif /* !WIDE */
 #include "test-string.h"
-
-char *simple_stpcpy (char *, const char *);
-
-IMPL (simple_stpcpy, 0)
-IMPL (stpcpy, 1)
-
-char *
-simple_stpcpy (char *dst, const char *src)
+#ifndef WIDE
+# define CHAR char
+# define SIMPLE_STPCPY simple_stpcpy
+# define STPCPY stpcpy
+#else
+# include <wchar.h>
+# define CHAR wchar_t
+# define SIMPLE_STPCPY simple_wcpcpy
+# define STPCPY wcpcpy
+#endif /* !WIDE */
+
+CHAR *SIMPLE_STPCPY (CHAR *, const CHAR *);
+
+IMPL (SIMPLE_STPCPY, 0)
+IMPL (STPCPY, 1)
+
+CHAR *
+SIMPLE_STPCPY (CHAR *dst, const CHAR *src)
 {
   while ((*dst++ = *src++) != '\0');
   return dst - 1;
 }
 
+#undef CHAR
 #include "test-strcpy.c"