aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk')
-rwxr-xr-xinclude/asterisk/channel.h13
-rwxr-xr-xinclude/asterisk/frame.h4
-rwxr-xr-xinclude/asterisk/lock.h4
3 files changed, 21 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 7c129f73c..28c566364 100755
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -829,6 +829,19 @@ static inline int ast_fdisset(struct pollfd *pfds, int fd, int max, int *start)
return 0;
}
+#ifdef SOLARIS
+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
+
//! Waits for activity on a group of channels
/*!
* \param nfds the maximum number of file descriptors in the sets
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index 784bea39c..1d59fee13 100755
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -22,6 +22,10 @@ extern "C" {
#include <sys/types.h>
#include <sys/time.h>
+
+#ifdef SOLARIS
+#include "solaris-compat/compat.h"
+#endif
/*
* Autodetect system endianess
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index f2066de38..81a31affa 100755
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -48,6 +48,10 @@
#define AST_MUTEX_KIND PTHREAD_MUTEX_RECURSIVE
#endif /* PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP */
+#ifdef SOLARIS
+#define AST_MUTEX_INIT_W_CONSTRUCTORS
+#endif
+
#ifdef DEBUG_THREADS
#ifdef THREAD_CRASH