Solaris compatibility fixes

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@288636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Tilghman Lesher 15 years ago
parent 947cea177f
commit b94a0e14a2

@ -1399,19 +1399,6 @@ static inline int ast_fdisset(struct pollfd *pfds, int fd, int max, int *start)
return 0;
}
#ifndef HAVE_TIMERSUB
static inline void timersub(struct timeval *tvend, struct timeval *tvstart, struct timeval *tvdiff)
{
tvdiff->tv_sec = tvend->tv_sec - tvstart->tv_sec;
tvdiff->tv_usec = tvend->tv_usec - tvstart->tv_usec;
if (tvdiff->tv_usec < 0) {
tvdiff->tv_sec --;
tvdiff->tv_usec += 1000000;
}
}
#endif
#define CHECK_BLOCKING(c) do { \
if (ast_test_flag(c, AST_FLAG_BLOCKING)) {\
if (option_debug) \

@ -62,6 +62,10 @@ int unsetenv(const char *name);
int vasprintf(char **strp, const char *fmt, va_list ap);
#endif
#ifndef HAVE_TIMERSUB
void timersub(struct timeval *tvend, struct timeval *tvstart, struct timeval *tvdiff);
#endif
#ifndef HAVE_STRLCAT
size_t strlcat(char *dst, const char *src, size_t siz) attribute_deprecated;
#endif

@ -38,6 +38,7 @@
asprintf;
strtoq;
getloadavg;
timersub;
strlcat;
strlcpy;
local:

@ -172,6 +172,19 @@ int vasprintf(char **strp, const char *fmt, va_list ap)
}
#endif /* !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC) */
#ifndef HAVE_TIMERSUB
void timersub(struct timeval *tvend, struct timeval *tvstart, struct timeval *tvdiff)
{
tvdiff->tv_sec = tvend->tv_sec - tvstart->tv_sec;
tvdiff->tv_usec = tvend->tv_usec - tvstart->tv_usec;
if (tvdiff->tv_usec < 0) {
tvdiff->tv_sec --;
tvdiff->tv_usec += 1000000;
}
}
#endif
/*
* Based on Code from bsd-asprintf from OpenSSH
* Copyright (c) 2004 Darren Tucker.

Loading…
Cancel
Save