Author: iratqq
Date: Mon Feb  2 01:28:28 2009
New Revision: 5790

Modified:
   trunk/configure.ac
   trunk/replace/Makefile.am
   trunk/replace/bsd-poll.c
   trunk/replace/os_dep.h

Log:
* configure.ac:
  - Check poll.h, sys/poll.h and poll().
* replace/Makefile.am (libreplace_la_SOURCES):
  - Add bsd-poll.c and bsd-poll.h
* replace/bsd-poll.c:
  - Replace include.h to config.h
* replace/os_dep.h (poll):
  - Add macro and declaration.


Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac  (original)
+++ trunk/configure.ac  Mon Feb  2 01:28:28 2009
@@ -320,6 +320,7 @@
 AC_CHECK_HEADERS([pty.h utmp.h util.h libutil.h])
 AC_CHECK_HEADERS([curses.h stropts.h])
 AC_CHECK_HEADERS([sys/param.h strings.h netdb.h sysexits.h])
+AC_CHECK_HEADERS([poll.h sys/poll.h])

 # Check for types
 AC_TYPE_INT8_T
@@ -519,6 +520,7 @@
 AC_CHECK_FUNCS([isascii])
 AC_CHECK_FUNCS([getaddrinfo freeaddrinfo getnameinfo])
 AC_CHECK_FUNCS([issetugid])
+AC_CHECK_FUNCS([poll])

 # IRIX has a const char return value for gai_strerror()
 AC_CHECK_FUNCS(gai_strerror,[

Modified: trunk/replace/Makefile.am
==============================================================================
--- trunk/replace/Makefile.am   (original)
+++ trunk/replace/Makefile.am   Mon Feb  2 01:28:28 2009
@@ -1,2 +1,2 @@
 noinst_LTLIBRARIES = libreplace.la
-libreplace_la_SOURCES = strsep.c getpeereid.c setenv.c os_dep.h strlcpy.c strlcat.c fake-rfc2553.c fake-rfc2553.h bsd-asprintf.c bsd-snprintf.c strtoll.c strtonum.c +libreplace_la_SOURCES = strsep.c getpeereid.c setenv.c os_dep.h strlcpy.c strlcat.c fake-rfc2553.c fake-rfc2553.h bsd-asprintf.c bsd-snprintf.c strtoll.c strtonum.c bsd-poll.c bsd-poll.h

Modified: trunk/replace/bsd-poll.c
==============================================================================
--- trunk/replace/bsd-poll.c    (original)
+++ trunk/replace/bsd-poll.c    Mon Feb  2 01:28:28 2009
@@ -16,7 +16,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */

-#include "includes.h"
+#include <config.h>
 #if !defined(HAVE_POLL)

 #ifdef HAVE_SYS_SELECT_H

Modified: trunk/replace/os_dep.h
==============================================================================
--- trunk/replace/os_dep.h      (original)
+++ trunk/replace/os_dep.h      Mon Feb  2 01:28:28 2009
@@ -119,6 +119,20 @@
long long strtonum(const char *numstr, long long minval, long long maxval, const char **errstrp);
 #endif

+#ifdef HAVE_POLL_H
+#include <poll.h>
+#elif HAVE_SYS_POLL_H
+#include <sys/poll.h>
+#else
+#include "bsd-poll.h"
+#endif
+
+#ifndef HAVE_POLL
+#define poll   uim_internal_poll
+int
+poll(struct pollfd *, nfds_t, int);
+#endif
+
 #ifdef __cplusplus
 }
 #endif

Reply via email to