aboutsummaryrefslogtreecommitdiff
path: root/benchtests/bench-stpcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'benchtests/bench-stpcpy.c')
-rw-r--r--benchtests/bench-stpcpy.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/benchtests/bench-stpcpy.c b/benchtests/bench-stpcpy.c
index 3d79432..843e6a9 100644
--- a/benchtests/bench-stpcpy.c
+++ b/benchtests/bench-stpcpy.c
@@ -18,19 +18,34 @@
#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 "bench-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 "bench-strcpy.c"