From: stolz Date: Fri, 11 Oct 2002 14:25:25 +0000 (+0000) Subject: [project @ 2002-10-11 14:25:24 by stolz] X-Git-Tag: Approx_11550_changesets_converted~1565 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=a5b47be19ba3a736aa60728dba43a14cd0cbe5a4 [project @ 2002-10-11 14:25:24 by stolz] 'usleep' nightmare: Sometimes return type is void, sometimes int. --- diff --git a/acconfig.h b/acconfig.h index 49fc3ad..d61c783 100644 --- a/acconfig.h +++ b/acconfig.h @@ -396,6 +396,9 @@ /* Define if RTLD_NOW is available */ #undef HAVE_RTLDNOW +/* Define if usleep returns void */ +#undef USLEEP_RETURNS_VOID + /* Define if C compiler supports long long types */ #undef HAVE_LONG_LONG diff --git a/configure.in b/configure.in index 64c942c..36e28c8 100644 --- a/configure.in +++ b/configure.in @@ -1109,6 +1109,24 @@ AC_SUBST(HaveRtldNow) FPTOOLS_CHECK_LIB_NOWARN(m, atan) +dnl ---------- usleep ---------- +dnl --- stolen from guile configure --- +dnl --- FIXME: /usr/include/unistd.h can't be right? + +### On some systems usleep has no return value. If it does have one, +### we'd like to return it; otherwise, we'll fake it. +AC_CACHE_CHECK([return type of usleep], cv_func_usleep_return_type, + [AC_EGREP_HEADER(changequote(<, >)changequote([, ]), + /usr/include/unistd.h, + [cv_func_usleep_return_type=void], + [cv_func_usleep_return_type=int])]) +case "$cv_func_usleep_return_type" in + "void" ) + AC_DEFINE(USLEEP_RETURNS_VOID, 1, + [Define if the system headers declare usleep to return void.]) + ;; +esac + dnl -------------------------------------------------- dnl * test for GTK+ dnl -------------------------------------------------- diff --git a/mk/config.h.in b/mk/config.h.in index b7d5889..d2b23e7 100644 --- a/mk/config.h.in +++ b/mk/config.h.in @@ -382,6 +382,9 @@ /* Define if RTLD_NOW is available */ #undef HAVE_RTLDNOW +/* Define if usleep returns void */ +#undef USLEEP_RETURNS_VOID + /* Define if C compiler supports long long types */ #undef HAVE_LONG_LONG