* configure.ac: Add test to check for poll emulation

* Source/NSRunLoop.h: Don't use poll if we're just emulating.
* Source/unix/GSRunLoopCtxt.m: Idem.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20788 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2005-02-23 22:17:54 +00:00
parent b00056dd18
commit cdbd239478
7 changed files with 335 additions and 154 deletions

View file

@ -1,3 +1,9 @@
2005-02-23 Adam Fedor <fedor@gnu.org>
* configure.ac: Add test to check for poll emulation
* Source/NSRunLoop.h: Don't use poll if we're just emulating.
* Source/unix/GSRunLoopCtxt.m: Idem.
2005-02-23 14:00 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Additions/GNUstepBase/GSFileHandle.h: Add windows event

View file

@ -32,7 +32,7 @@ and libraries the use the base library need to be recompiled to use it.
@itemize @bullet
@item A large majority of the library classes have been documented thanks to
the efforts of Andrew Ruder
the efforts of Adrian Robert
@item URL classes support persistant connections
@item Mac OSX XML compatibility fixes.
@end itemize

View file

@ -157,6 +157,9 @@
/* Define to 1 if you have the `poll' function. */
#undef HAVE_POLL
/* Define if poll is NOT emulated via select */
#undef HAVE_POLL_F
/* Define to 1 if you have the <poll.h> header file. */
#undef HAVE_POLL_H

View file

@ -49,13 +49,9 @@
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_POLL_H
#ifdef HAVE_POLL_F
#include <poll.h>
#endif
/* Some systems (e.g. MacOSX) just emulate poll and prefer select */
#ifdef _POLL_EMUL_H_
#undef HAVE_POLL
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@ -705,7 +701,7 @@ extern IMP wRetImp;
_contextMap = NSCreateMapTable (NSNonRetainedObjectMapKeyCallBacks,
NSObjectMapValueCallBacks, 0);
_timedPerformers = [[NSMutableArray alloc] initWithCapacity: 8];
#ifdef HAVE_POLL
#ifdef HAVE_POLL_F
_extra = objc_malloc(sizeof(pollextra));
memset(_extra, '\0', sizeof(pollextra));
#endif
@ -721,7 +717,7 @@ extern IMP wRetImp;
- (void) gcFinalize
{
#ifdef HAVE_POLL
#ifdef HAVE_POLL_F
if (_extra != 0)
{
pollextra *e = (pollextra*)_extra;

View file

@ -21,7 +21,7 @@
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_POLL_H
#ifdef HAVE_POLL_F
#include <poll.h>
#endif
#ifdef HAVE_UNISTD_H
@ -80,7 +80,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
{
NSFreeMapTable(_wfdMap);
}
#ifdef HAVE_POLL
#ifdef HAVE_POLL_F
if (pollfds != 0)
{
objc_free(pollfds);
@ -164,7 +164,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
return self;
}
#ifdef HAVE_POLL
#ifdef HAVE_POLL_F
static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
{

448
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -568,7 +568,19 @@ AC_CHECK_FUNCS(syslog)
#--------------------------------------------------------------------
AC_CHECK_HEADERS(poll.h)
AC_CHECK_FUNCS(poll)
have_poll=no
if test $ac_cv_header_poll_h = yes; then
have_poll=yes
AC_MSG_CHECKING(for poll emulation)
AC_EGREP_CPP(emulating_poll, [#include "config/config.poll.c"],
have_poll=no,)
if test $have_poll = yes; then
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_POLL_F,1, [ Define if poll is NOT emulated via select])
else
AC_MSG_RESULT(yes)
fi
fi
#--------------------------------------------------------------------
# Check for pthread.h (only when building on Darwin machines)