mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-18 17:50:29 +02:00
* scmsigs.c: Declare usleep as returning void on some systems.
(scm_usleep): Return SCM_INUM0 on those systems. * coop.c (usleep): Return void on some systems. * configure.in: Define USLEEP_RETURNS_VOID on some systems.
This commit is contained in:
parent
f1a5fa3c92
commit
0935d604b5
9 changed files with 152 additions and 92 deletions
|
@ -1,3 +1,10 @@
|
|||
1998-04-25 Mikael Djurfeldt <mdj@kenneth>
|
||||
|
||||
* scmsigs.c: Declare usleep as returning void on some systems.
|
||||
(scm_usleep): Return SCM_INUM0 on those systems.
|
||||
|
||||
* coop.c (usleep): Return void on some systems.
|
||||
|
||||
1998-04-20 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
|
||||
|
||||
* Makefile.am (libguile_la_LDFLAGS): Removed redundant -rpath.
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
* If you do not wish that, delete this exception notice. */
|
||||
|
||||
|
||||
/* $Id: coop.c,v 1.9 1998-04-20 00:39:15 mdj Exp $ */
|
||||
/* $Id: coop.c,v 1.10 1998-04-24 23:36:02 mdj Exp $ */
|
||||
|
||||
/* Cooperative thread library, based on QuickThreads */
|
||||
|
||||
|
@ -652,15 +652,21 @@ coop_sleephelp (sp, old, bolckq)
|
|||
|
||||
#ifdef GUILE_ISELECT
|
||||
|
||||
#ifdef USLEEP_RETURNS_VOID
|
||||
void
|
||||
#else
|
||||
int
|
||||
#endif
|
||||
usleep (unsigned usec)
|
||||
{
|
||||
struct timeval timeout;
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = usec;
|
||||
scm_internal_select (0, NULL, NULL, NULL, &timeout);
|
||||
#ifndef USLEEP_RETURNS_VOID
|
||||
return 0; /* Maybe we should calculate actual time slept,
|
||||
but this is faster... :) */
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned
|
||||
|
|
|
@ -176,6 +176,9 @@
|
|||
/* Define if the operating system supplies usleep without declaring it. */
|
||||
#undef DECLARE_USLEEP
|
||||
|
||||
/* Define if usleep doesn't return a value. */
|
||||
#undef USLEEP_RETURNS_VOID
|
||||
|
||||
/* Define if you have the bzero function. */
|
||||
#undef HAVE_BZERO
|
||||
|
||||
|
|
|
@ -53,8 +53,12 @@
|
|||
#endif
|
||||
|
||||
#if defined(DECLARE_USLEEP) || (defined(GUILE_ISELECT) && !defined(HAVE_USLEEP))
|
||||
#ifdef USLEEP_RETURNS_VOID
|
||||
extern void usleep (unsigned);
|
||||
#else
|
||||
extern int usleep (unsigned);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -364,8 +368,13 @@ scm_usleep (i)
|
|||
{
|
||||
int j;
|
||||
SCM_ASSERT (SCM_INUMP (i) && (SCM_INUM (i) >= 0), i, SCM_ARG1, s_usleep);
|
||||
j = usleep (SCM_INUM(i));
|
||||
#ifdef USLEEP_RETURNS_VOID
|
||||
usleep (SCM_INUM (i));
|
||||
return SCM_INUM0;
|
||||
#else
|
||||
j = usleep (SCM_INUM (i));
|
||||
return SCM_MAKINUM (j);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue