From b6157823fe289a595e119026d110d4eb2cc48221 Mon Sep 17 00:00:00 2001 From: tomo Date: Fri, 3 Oct 2003 03:25:06 +0000 Subject: [PATCH] New file [separate from chise.c]. --- sysdep.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sysdep.h diff --git a/sysdep.h b/sysdep.h new file mode 100644 index 0000000..3ac1736 --- /dev/null +++ b/sysdep.h @@ -0,0 +1,22 @@ +#ifndef _CHISE_SYSDEP_H +#define _CHISE_SYSDEP_H + +#include + +#ifndef HAVE_STRNLEN +/* original in mysql, strings/strnlen.c. +uint strnlen(register const char *s, register uint maxlen) +{ + const char *end= (const char *)memchr(s, '\0', maxlen); + return end ? (uint) (end - s) : maxlen; +} +*/ +static inline int +strnlen (register const char *s, register int maxlen) +{ + const char *end= (const char *)memchr(s, '\0', maxlen); + return end ? (int) (end - s) : maxlen; +} +#endif + +#endif /* !_CHISE_SYSDEP_H */ -- 1.7.10.4