Remove obsolete code using sleep() in wxMicroSleep() for BeOS

This code never worked (as proved by the conversion in it which was
wrong by a factor of 1e12) and should never be needed anyhow.

Simplify configure and give an error, not warning, if neither
nanosleep() nor usleep() are available, as otherwise we'd just get a
build error later when compiling utilsunx.cpp later.
This commit is contained in:
Vadim Zeitlin
2020-06-26 18:49:32 +02:00
parent 31581c0f41
commit f66199222e
3 changed files with 4 additions and 29 deletions

View File

@@ -4516,22 +4516,11 @@ if test "$ac_cv_func_setenv" = "yes"; then
AC_CHECK_FUNCS(unsetenv)
fi
HAVE_SOME_SLEEP_FUNC=0
if test "$USE_BEOS" = 1; then
dnl BeOS has its own (wonder where did they get it from) sleep() function
dnl in unistd.h
AC_DEFINE(HAVE_SLEEP)
HAVE_SOME_SLEEP_FUNC=1
fi
if test "$USE_DARWIN" = 1; then
dnl Mac OS X/Darwin has both nanosleep and usleep
dnl but only usleep is defined in unistd.h
AC_DEFINE(HAVE_USLEEP)
HAVE_SOME_SLEEP_FUNC=1
fi
if test "$HAVE_SOME_SLEEP_FUNC" != 1; then
else
dnl try nanosleep() in libc and libposix4, if this fails - usleep()
POSIX4_LINK=
AC_CHECK_FUNCS(nanosleep,
@@ -4544,7 +4533,7 @@ if test "$HAVE_SOME_SLEEP_FUNC" != 1; then
],
[
WX_CHECK_FUNCS(usleep,,
AC_MSG_WARN([wxSleep() function will not work])
AC_MSG_ERROR([wxMicroSleep() can't be implemented])
)
]
)