compat.h revision cfa6145b5df51927a401981b1b32d718ffe5431e
#ifndef __COMPAT_H
#define __COMPAT_H
/* well, this is obviously wrong since it assumes it's 64bit, but older
GCCs don't define it and we really want it. */
#ifndef LLONG_MAX
# define LLONG_MAX 9223372036854775807LL
#endif
#if defined (UOFF_T_INT)
typedef unsigned int uoff_t;
#elif defined (UOFF_T_LONG)
typedef unsigned long uoff_t;
#elif defined (UOFF_T_LONG_LONG)
typedef unsigned long long uoff_t;
#else
#endif
#ifndef HAVE_UINTMAX_T
# if SIZEOF_LONG_LONG > 0
typedef unsigned long long uintmax_t;
# else
typedef unsigned long uintmax_t;
# endif
#endif
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
#ifdef HAVE_SYS_SYSMACROS_H
# include <sys/sysmacros.h>
#elif !defined (DEV_T_STRUCT)
# define CMP_DEV_T(a, b) ((a) == (b))
#else
#endif
/* memmove() */
#ifndef HAVE_MEMMOVE
# define memmove my_memmove
#endif
/* strcasecmp(), strncasecmp() */
#ifndef HAVE_STRCASECMP
# ifdef HAVE_STRICMP
# define strcasecmp stricmp
# define strncasecmp strnicmp
# else
# define strcasecmp my_strcasecmp
# define strncasecmp my_strncasecmp
# endif
#endif
#ifndef HAVE_INET_ATON
# define inet_aton my_inet_aton
#endif
#ifndef HAVE_VSYSLOG
# define vsyslog my_vsyslog
#endif
#ifndef HAVE_GETPAGESIZE
# define getpagesize my_getpagesize
int my_getpagesize(void);
#endif
#ifndef HAVE_FDATASYNC
#endif
#ifndef HAVE_STRUCT_IOVEC
struct iovec {
void *iov_base;
};
#endif
#ifndef HAVE_WRITEV
struct iovec;
#endif
/* ctype.h isn't safe with signed chars,
use our own instead if really needed */
#define i_isxdigit(x) isxdigit((int) (unsigned char) (x))
#ifndef EOVERFLOW
#endif
#endif