*/
#ifndef NEED_BSDREGEX
# if (defined(SYSV) || defined(NETBSD) || defined(FREEBSD) || \
- defined(__OpenBSD__) || defined(linux) || defined(DARWIN)) && \
+ defined(__OpenBSD__) || defined(linux) || defined(DARWIN) || \
+ defined(__GNU__) || defined(__GLIBC__)) && \
!defined(sgi)
# define NEED_BSDREGEX
# endif
/*
* Is snprintf() part of the standard C runtime library?
*/
+#if !defined(HAVE_SNPRINTF)
+#if defined(SOLARIS) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(HPUX) || defined(AIX)
+#define HAVE_SNPRINTF
+#endif
#if defined(_WINDOWS)
# define snprintf _snprintf
#endif
+#endif
/*
* Async IO. Use a non blocking implementation of connect() and
*/
#if !defined(WINSOCK) && !defined(_WINDOWS) && !defined(macintosh) && \
!defined(XP_OS2)
-# if defined(hpux) || defined(LINUX) || defined(SUNOS4) || defined(XP_BEOS)
+# if defined(hpux) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(SUNOS4) || defined(XP_BEOS)
# include <sys/time.h>
# else
# include <sys/select.h>
# define HAVE_TIME_R
#endif
-#if defined(SNI) || defined(LINUX1_2)
+#if defined(SNI) || defined(LINUX1_2) || defined(__GNU__) || defined(__GLIBC__)
int strcasecmp(const char*, const char*);
# ifdef SNI
int strncasecmp(const char*, const char*, int);
# define NSLDAPI_NETDB_BUF_SIZE 1024
# endif
-# if defined(sgi) || defined(HPUX9) || defined(SCOOS) || defined(UNIXWARE) || \
+#if defined(__GLIBC__) && __GLIBC__ >= 2
+typedef char GETHOSTBYNAME_buf_t [NSLDAPI_NETDB_BUF_SIZE];
+# define GETHOSTBYNAME_BUF_T GETHOSTBYNAME_buf_t
+# define GETHOSTBYNAME( n, r, b, l, rp, e ) gethostbyname_r( n, r, b, l, rp, e )
+# define GETHOSTBYNAME_R_RETURNS_INT
+#elif defined(sgi) || defined(HPUX9) || defined(SCOOS) || defined(UNIXWARE) || \
defined(SUNOS4) || defined(SNI) || defined(BSDI) || defined(NCR) || \
defined(OSF1) || defined(NEC) || defined(VMS) || \
(defined(HPUX10) && !defined(_REENTRANT)) || defined(HPUX11) || \
# define GETHOSTBYNAME_BUF_T struct hostent_data
# define GETHOSTBYNAME(n, r, b, l, e) \
nsldapi_compat_gethostbyname_r(n, r, (char*)&b, l, e)
-# elif defined(LINUX) || defined(DRAGONFLY)
+# elif defined(LINUX) || defined(DRAGONFLY) || defined(__GNU__) || defined(__GLIBC__)
typedef char GETHOSTBYNAME_buf_t[NSLDAPI_NETDB_BUF_SIZE];
# define GETHOSTBYNAME_BUF_T GETHOSTBYNAME_buf_t
# define GETHOSTBYNAME(n, r, b, l, rp, e) gethostbyname_r(n, r, b, l, rp, e)
defined(OSF1V4) || defined(AIX) || defined(UnixWare) || defined(hpux) || \
defined(HPUX11) || defined(NETBSD) || defined(IRIX6) || \
defined(FREEBSD) || defined(VMS) || defined(NTO) || defined(OPENBSD) || \
- defined(DRAGONFLY)
+ defined(DRAGONFLY || defined(__GLIBC__))
# define NSLDAPI_CTIME(c, b, l) ctime_r(c, b)
# elif defined(OSF1V3)
# define NSLDAPI_CTIME(c, b, l) (ctime_r(c, b, l) ? NULL : b)
# define NSLDAPI_FOPEN(filename, mode) fopen(filename, mode)
#endif
-#if defined(LINUX) || defined(AIX) || defined(HPUX) || defined(_WINDOWS)
+#if defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(AIX) || defined(HPUX) || defined(_WINDOWS)
size_t nsldapi_compat_strlcpy(char* dst, const char* src, size_t len);
# define STRLCPY nsldapi_compat_strlcpy
#else