diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/autoconfig.h.in | 3 | ||||
-rw-r--r-- | include/asterisk/channel.h | 4 | ||||
-rw-r--r-- | include/asterisk/io.h | 4 | ||||
-rw-r--r-- | include/asterisk/poll-compat.h | 30 |
4 files changed, 21 insertions, 20 deletions
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in index 81b08a89f..ae00a91e9 100644 --- a/include/asterisk/autoconfig.h.in +++ b/include/asterisk/autoconfig.h.in @@ -7,6 +7,9 @@ +/* Define to 1 if internal poll should be used. */ +#undef AST_POLL_COMPAT + /* Define to 1 if the `closedir' function returns void instead of `int'. */ #undef CLOSEDIR_VOID diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 8bda3ac5c..95e5d69e7 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -125,11 +125,7 @@ References: #include "asterisk/abstract_jb.h" -#ifdef HAVE_SYS_POLL_H -#include <sys/poll.h> -#else #include "asterisk/poll-compat.h" -#endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { diff --git a/include/asterisk/io.h b/include/asterisk/io.h index ee22994a4..2bddd3780 100644 --- a/include/asterisk/io.h +++ b/include/asterisk/io.h @@ -23,11 +23,7 @@ #ifndef _ASTERISK_IO_H #define _ASTERISK_IO_H -#ifdef HAVE_SYS_POLL_H -#include <sys/poll.h> /* For POLL* constants */ -#else #include "asterisk/poll-compat.h" -#endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { diff --git a/include/asterisk/poll-compat.h b/include/asterisk/poll-compat.h index 5f795a894..1156e694b 100644 --- a/include/asterisk/poll-compat.h +++ b/include/asterisk/poll-compat.h @@ -76,8 +76,16 @@ original. \*---------------------------------------------------------------------------*/ -#ifndef _POLL_EMUL_H_ -#define _POLL_EMUL_H_ +#ifndef __AST_POLL_COMPAT_H +#define __AST_POLL_COMPAT_H + +#ifndef AST_POLL_COMPAT + +#include <sys/poll.h> + +#define ast_poll(a, b, c) poll(a, b, c) + +#else /* AST_POLL_COMPAT */ #define POLLIN 0x01 #define POLLPRI 0x02 @@ -86,26 +94,24 @@ #define POLLHUP 0x10 #define POLLNVAL 0x20 -struct pollfd -{ +struct pollfd { int fd; short events; short revents; }; #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif -#if (__STDC__ > 0) || defined(__cplusplus) -extern int poll (struct pollfd *pArray, unsigned long n_fds, int timeout); -#else -extern int poll(); -#endif +#define ast_poll(a, b, c) ast_internal_poll(a, b, c) + +int ast_internal_poll(struct pollfd *pArray, unsigned long n_fds, int timeout); #ifdef __cplusplus } #endif -#endif /* _POLL_EMUL_H_ */ +#endif /* AST_POLL_COMPAT */ + +#endif /* __AST_POLL_COMPAT_H */ |