diff --git a/libguile/iselect.c b/libguile/iselect.c index 59d2b795a..ceb1c4a99 100644 --- a/libguile/iselect.c +++ b/libguile/iselect.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ #include "libguile/iselect.h" -#ifdef GUILE_ISELECT +#ifdef USE_COOP_THREADS #include "libguile/coop-threads.h" @@ -623,8 +623,6 @@ scm_init_iselect () #include "libguile/iselect.x" } -#endif /* GUILE_ISELECT */ - int scm_internal_select (int nfds, SELECT_TYPE *readfds, @@ -632,11 +630,6 @@ scm_internal_select (int nfds, SELECT_TYPE *exceptfds, struct timeval *timeout) { -#ifndef GUILE_ISELECT - int res = select (nfds, readfds, writefds, exceptfds, timeout); - SCM_ASYNC_TICK; - return res; -#else /* GUILE_ISELECT */ struct timeval now; coop_t *t, *curr = coop_global_curr; @@ -691,9 +684,32 @@ scm_internal_select (int nfds, SCM_ALLOW_INTS; SCM_ASYNC_TICK; return coop_global_curr->retval; -#endif /* GUILE_ISELECT */ } +#else +#ifdef USE_NULL_THREADS + +int +scm_internal_select (int nfds, + SELECT_TYPE *readfds, + SELECT_TYPE *writefds, + SELECT_TYPE *exceptfds, + struct timeval *timeout) +{ + int res = select (nfds, readfds, writefds, exceptfds, timeout); + SCM_ASYNC_TICK; + return res; +} + +void +scm_init_iselect () +{ +#include "libguile/iselect.x" +} + +#endif /* USE_NULL_THREADS */ +#endif /* !USE_COOP_THREADS */ + /* Local Variables: c-file-style: "gnu" diff --git a/libguile/iselect.h b/libguile/iselect.h index 1d27013fb..71f74469c 100644 --- a/libguile/iselect.h +++ b/libguile/iselect.h @@ -3,7 +3,7 @@ #ifndef SCM_ISELECT_H #define SCM_ISELECT_H -/* Copyright (C) 1997,1998,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1997,1998,2000,2001, 2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -95,14 +95,15 @@ SCM_API int scm_internal_select (int fds, SELECT_TYPE *efds, struct timeval *timeout); -#ifdef GUILE_ISELECT +#ifdef USE_COOP_THREADS SCM_API int scm_I_am_dead; SCM_API void scm_error_revive_threads (void); -SCM_API void scm_init_iselect (void); -#endif /* GUILE_ISELECT */ +#endif /* USE_COOP_THREADS */ + +SCM_API void scm_init_iselect (void); #endif /* SCM_ISELECT_H */