]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Solaris compatibility fixes
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 24 Sep 2010 03:20:24 +0000 (03:20 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 24 Sep 2010 03:20:24 +0000 (03:20 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@288636 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/channel.h
include/asterisk/compat.h
main/asterisk.exports
main/strcompat.c

index 750f56690c49ea2e77082ce3694bf01e2b7fa08e..fb0046782662a633455421bf71a26102b8d2c411 100644 (file)
@@ -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) \
index d91ce4a1ac17784aab32d0aea1f66fedbd86618c..2168f8c36f5381bb517bbc02d3c2e3219840ff1b 100644 (file)
@@ -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
index b50350606869b6c68f59483dae8b6161fe081072..61567310d4a646d277311d20ed21edce519f7c62 100644 (file)
@@ -38,6 +38,7 @@
                asprintf;
                strtoq;
                getloadavg;
+               timersub;
                strlcat;
                strlcpy;
        local:
index 243ef76cb0292f70574c51d50c991bedd0fc7207..2840c91909c43a65169c23eeb41dae1bfa2530f3 100644 (file)
@@ -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.