From 7b3551e3a8f7278e123757987570c72f1216acc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20B=C3=ADlka?= Date: Fri, 28 Feb 2014 22:45:33 +0100 Subject: Make strtok benchmark competive. We include a generic version of strtok to result which could be faster when underlying primitives are better optimized than current version. --- string/strtok.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'string/strtok.c') diff --git a/string/strtok.c b/string/strtok.c index f7f7099..2253440 100644 --- a/string/strtok.c +++ b/string/strtok.c @@ -22,6 +22,10 @@ static char *olds; #undef strtok +#ifndef STRTOK +# define STRTOK strtok +#endif + /* Parse S into tokens separated by characters in DELIM. If S is NULL, the last string strtok() was called with is used. For example: @@ -32,7 +36,7 @@ static char *olds; // s = "abc\0=-def\0" */ char * -strtok (s, delim) +STRTOK (s, delim) char *s; const char *delim; { -- cgit v1.1