Alexandre Julliard : libport: Remove the usleep() function replacement.

Alexandre Julliard julliard at winehq.org
Tue Dec 1 15:40:33 CST 2020


Module: wine
Branch: master
Commit: 7b4e10c7076ae97145de0c8a1575bf9590f6edb8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7b4e10c7076ae97145de0c8a1575bf9590f6edb8

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Dec  1 10:21:21 2020 +0100

libport: Remove the usleep() function replacement.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure                    |  4 +---
 configure.ac                 |  4 +---
 dlls/winex11.drv/clipboard.c |  6 +++---
 include/config.h.in          |  6 ------
 include/wine/port.h          |  5 -----
 libs/port/Makefile.in        |  3 +--
 libs/port/usleep.c           | 47 --------------------------------------------
 7 files changed, 6 insertions(+), 69 deletions(-)

diff --git a/configure b/configure
index 7ac509dec10..283cac2f979 100755
--- a/configure
+++ b/configure
@@ -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`
diff --git a/configure.ac b/configure.ac
index 69254a9631d..853f99e8b1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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"
 
diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c
index 695c0406a80..8a0617cfede 100644
--- a/dlls/winex11.drv/clipboard.c
+++ b/dlls/winex11.drv/clipboard.c
@@ -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 ||
diff --git a/include/config.h.in b/include/config.h.in
index a6d45bf031f..0bed21d9cea 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -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
 
diff --git a/include/wine/port.h b/include/wine/port.h
index a4bcbc757b7..936f69d3bde 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -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 */
 
diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in
index 26b8fae4f3d..764a56f62ae 100644
--- a/libs/port/Makefile.in
+++ b/libs/port/Makefile.in
@@ -12,5 +12,4 @@ C_SRCS = \
 	pwrite.c \
 	readlink.c \
 	spawn.c \
-	symlink.c \
-	usleep.c
+	symlink.c
diff --git a/libs/port/usleep.c b/libs/port/usleep.c
deleted file mode 100644
index da4ee3581c9..00000000000
--- a/libs/port/usleep.c
+++ /dev/null
@@ -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 */




More information about the wine-cvs mailing list