From: tomo Date: Fri, 3 Oct 2003 03:25:06 +0000 (+0000) Subject: New file [separate from chise.c]. X-Git-Tag: b1-r0_2_0-pre6~7 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=b6157823fe289a595e119026d110d4eb2cc48221;p=chise%2Flibchise.git New file [separate from chise.c]. --- 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 */