(cos_release_object): Fixed.
[chise/concord.git] / sysdep.h
1 #ifndef _CHISE_SYSDEP_H
2 #define _CHISE_SYSDEP_H
3
4 #include <string.h>
5 #ifdef HAVE_CONFIG_H
6 #  include "config.h"
7 #endif
8
9 #ifndef HAVE_STRNLEN
10 /* original in mysql, strings/strnlen.c.
11 uint strnlen(register const char *s, register uint maxlen)
12 {
13   const char *end= (const char *)memchr(s, '\0', maxlen);
14   return end ? (uint) (end - s) : maxlen;
15 }
16 */
17 static inline int
18 strnlen (register const char *s, register int maxlen)
19 {
20   const char *end= (const char *)memchr(s, '\0', maxlen);
21   return end ? (int) (end - s) : maxlen;
22 }
23 #endif
24
25 #define xzero(lvalue) ((void) memset (&(lvalue), '\0', sizeof (lvalue)))
26
27 #endif /* !_CHISE_SYSDEP_H */