libport: Remove the usleep() function replacement.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-12-01 10:21:21 +01:00
parent db7c934f8e
commit 7b4e10c707
7 changed files with 6 additions and 69 deletions

4
configure vendored
View File

@ -17778,7 +17778,6 @@ for ac_func in \
readdir \
readlink \
sched_yield \
select \
setproctitle \
setprogname \
settimeofday \
@ -17787,8 +17786,7 @@ for ac_func in \
symlink \
sysinfo \
tcdrain \
thr_kill2 \
usleep
thr_kill2
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`

View File

@ -2187,7 +2187,6 @@ AC_CHECK_FUNCS(\
readdir \
readlink \
sched_yield \
select \
setproctitle \
setprogname \
settimeofday \
@ -2196,8 +2195,7 @@ AC_CHECK_FUNCS(\
symlink \
sysinfo \
tcdrain \
thr_kill2 \
usleep
thr_kill2
)
CFLAGS="$ac_save_CFLAGS"

View File

@ -95,7 +95,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(clipboard);
/* Maximum wait time for selection notify */
#define SELECTION_RETRIES 500 /* wait for .5 seconds */
#define SELECTION_WAIT 1000 /* us */
#define SELECTION_WAIT 1 /* ms */
#define SELECTION_UPDATE_DELAY 2000 /* delay between checks of the X11 selection */
@ -458,7 +458,7 @@ static BOOL convert_selection( Display *display, Window win, Atom selection,
Bool res = XCheckTypedWindowEvent( display, win, SelectionNotify, &event );
if (res && event.xselection.selection == selection && event.xselection.target == format->atom)
return read_property( display, win, event.xselection.property, type, data, size );
usleep( SELECTION_WAIT );
Sleep( SELECTION_WAIT );
}
ERR( "Timed out waiting for SelectionNotify event\n" );
return FALSE;
@ -1691,7 +1691,7 @@ static BOOL read_property( Display *display, Window w, Atom prop,
if (res && xe.xproperty.atom == prop &&
xe.xproperty.state == PropertyNewValue)
break;
usleep(SELECTION_WAIT);
Sleep(SELECTION_WAIT);
}
if (i >= SELECTION_RETRIES ||

View File

@ -762,9 +762,6 @@
/* Define to 1 if you have the <Security/Security.h> header file. */
#undef HAVE_SECURITY_SECURITY_H
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
/* Define to 1 if you have the `setproctitle' function. */
#undef HAVE_SETPROCTITLE
@ -1118,9 +1115,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `usleep' function. */
#undef HAVE_USLEEP
/* Define to 1 if you have the <utime.h> header file. */
#undef HAVE_UTIME_H

View File

@ -277,10 +277,6 @@ int readlink( const char *path, char *buf, size_t size );
int symlink(const char *from, const char *to);
#endif
#ifndef HAVE_USLEEP
int usleep (unsigned int useconds);
#endif /* !defined(HAVE_USLEEP) */
extern int mkstemps(char *template, int suffix_len);
#else /* NO_LIBWINE_PORT */
@ -292,7 +288,6 @@ extern int mkstemps(char *template, int suffix_len);
#define lstat __WINE_NOT_PORTABLE(lstat)
#define pread __WINE_NOT_PORTABLE(pread)
#define pwrite __WINE_NOT_PORTABLE(pwrite)
#define usleep __WINE_NOT_PORTABLE(usleep)
#endif /* NO_LIBWINE_PORT */

View File

@ -12,5 +12,4 @@ C_SRCS = \
pwrite.c \
readlink.c \
spawn.c \
symlink.c \
usleep.c
symlink.c

View File

@ -1,47 +0,0 @@
/*
* usleep function
*
* Copyright 1996 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <errno.h>
#ifndef HAVE_USLEEP
int usleep (unsigned int useconds)
{
#if defined(__EMX__)
DosSleep(useconds);
return 0;
#elif defined(__BEOS__)
return snooze(useconds);
#elif defined(HAVE_SELECT)
struct timeval delay;
delay.tv_sec = useconds / 1000000;
delay.tv_usec = useconds % 1000000;
select( 0, 0, 0, 0, &delay );
return 0;
#else /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */
errno = ENOSYS;
return -1;
#endif /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */
}
#endif /* HAVE_USLEEP */