From 21cec48570d4f358312409c778675c2d8502f272 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 3 Sep 2021 14:54:16 +0200 Subject: [PATCH] configure: Remove some no longer needed configure checks. Signed-off-by: Alexandre Julliard --- configure | 19 ++------ configure.ac | 12 +---- include/config.h.in | 24 ---------- include/wine/port.h | 24 ---------- libs/port/Makefile.in | 3 -- libs/port/poll.c | 101 ------------------------------------------ libs/port/pread.c | 50 --------------------- libs/port/pwrite.c | 50 --------------------- 8 files changed, 5 insertions(+), 278 deletions(-) delete mode 100644 libs/port/poll.c delete mode 100644 libs/port/pread.c delete mode 100644 libs/port/pwrite.c diff --git a/configure b/configure index 88074e4e276..99283e0ef18 100755 --- a/configure +++ b/configure @@ -7502,7 +7502,6 @@ for ac_header in \ gsm.h \ gsm/gsm.h \ ieeefp.h \ - inet/mib2.h \ libproc.h \ link.h \ linux/cdrom.h \ @@ -7539,7 +7538,6 @@ for ac_header in \ scsi/scsi_ioctl.h \ scsi/sg.h \ stdint.h \ - stropts.h \ sys/attr.h \ sys/auxv.h \ sys/cdio.h \ @@ -7551,7 +7549,6 @@ for ac_header in \ sys/link.h \ sys/mman.h \ sys/modem.h \ - sys/msg.h \ sys/mtio.h \ sys/param.h \ sys/poll.h \ @@ -7571,7 +7568,6 @@ for ac_header in \ sys/strtio.h \ sys/syscall.h \ sys/sysinfo.h \ - sys/tihdr.h \ sys/time.h \ sys/timeout.h \ sys/times.h \ @@ -18014,9 +18010,7 @@ for ac_func in \ port_create \ posix_fadvise \ prctl \ - pread \ proc_pidinfo \ - pwrite \ readlink \ sched_yield \ setproctitle \ @@ -18329,17 +18323,12 @@ if test "$ac_res" != no; then : fi -for ac_func in \ - getaddrinfo \ - getnameinfo \ - getservbyport \ - +for ac_func in getaddrinfo do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" +if test "x$ac_cv_func_getaddrinfo" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_GETADDRINFO 1 _ACEOF fi diff --git a/configure.ac b/configure.ac index e10bcca50e1..26f74985924 100644 --- a/configure.ac +++ b/configure.ac @@ -467,7 +467,6 @@ AC_CHECK_HEADERS(\ gsm.h \ gsm/gsm.h \ ieeefp.h \ - inet/mib2.h \ libproc.h \ link.h \ linux/cdrom.h \ @@ -504,7 +503,6 @@ AC_CHECK_HEADERS(\ scsi/scsi_ioctl.h \ scsi/sg.h \ stdint.h \ - stropts.h \ sys/attr.h \ sys/auxv.h \ sys/cdio.h \ @@ -516,7 +514,6 @@ AC_CHECK_HEADERS(\ sys/link.h \ sys/mman.h \ sys/modem.h \ - sys/msg.h \ sys/mtio.h \ sys/param.h \ sys/poll.h \ @@ -536,7 +533,6 @@ AC_CHECK_HEADERS(\ sys/strtio.h \ sys/syscall.h \ sys/sysinfo.h \ - sys/tihdr.h \ sys/time.h \ sys/timeout.h \ sys/times.h \ @@ -2188,9 +2184,7 @@ AC_CHECK_FUNCS(\ port_create \ posix_fadvise \ prctl \ - pread \ proc_pidinfo \ - pwrite \ readlink \ sched_yield \ setproctitle \ @@ -2223,11 +2217,7 @@ dnl Check for -lresolv for Solaris AC_SEARCH_LIBS(inet_aton, resolv) dnl **** Check for functions which may rely on -lsocket on Solaris. -AC_CHECK_FUNCS(\ - getaddrinfo \ - getnameinfo \ - getservbyport \ -) +AC_CHECK_FUNCS(getaddrinfo) dnl Check for clock_gettime which may be in -lrt case $host_os in diff --git a/include/config.h.in b/include/config.h.in index 2b488894a49..9f8e7f34ada 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -147,9 +147,6 @@ /* Define to 1 if you have the `getifaddrs' function. */ #undef HAVE_GETIFADDRS -/* Define to 1 if you have the `getnameinfo' function. */ -#undef HAVE_GETNAMEINFO - /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H @@ -159,9 +156,6 @@ /* Define to 1 if you have the `getrandom' function. */ #undef HAVE_GETRANDOM -/* Define to 1 if you have the `getservbyport' function. */ -#undef HAVE_GETSERVBYPORT - /* Define to 1 if you have the header file. */ #undef HAVE_GETTEXT_PO_H @@ -198,9 +192,6 @@ /* Define to 1 if you have the `if_nameindex' function. */ #undef HAVE_IF_NAMEINDEX -/* Define to 1 if you have the header file. */ -#undef HAVE_INET_MIB2_H - /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H @@ -519,9 +510,6 @@ /* Define to 1 if you have the `prctl' function. */ #undef HAVE_PRCTL -/* Define to 1 if you have the `pread' function. */ -#undef HAVE_PREAD - /* Define to 1 if you have the `proc_pidinfo' function. */ #undef HAVE_PROC_PIDINFO @@ -540,9 +528,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H -/* Define to 1 if you have the `pwrite' function. */ -#undef HAVE_PWRITE - /* Define to 1 if you have the header file. */ #undef HAVE_QUICKTIME_IMAGECOMPRESSION_H @@ -627,9 +612,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the header file. */ -#undef HAVE_STROPTS_H - /* Define to 1 if `direction' is a member of `struct ff_effect'. */ #undef HAVE_STRUCT_FF_EFFECT_DIRECTION @@ -794,9 +776,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MOUNT_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MSG_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MTIO_H @@ -866,9 +845,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_THR_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIHDR_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMEOUT_H diff --git a/include/wine/port.h b/include/wine/port.h index 15d1ed6315c..432fb23223b 100644 --- a/include/wine/port.h +++ b/include/wine/port.h @@ -194,30 +194,6 @@ extern int getopt_long_only (int ___argc, char *const *___argv, int lstat(const char *file_name, struct stat *buf); #endif /* HAVE_LSTAT */ -#ifndef HAVE_POLL -struct pollfd -{ - int fd; - short events; - short revents; -}; -#define POLLIN 0x01 -#define POLLPRI 0x02 -#define POLLOUT 0x04 -#define POLLERR 0x08 -#define POLLHUP 0x10 -#define POLLNVAL 0x20 -int poll( struct pollfd *fds, unsigned int count, int timeout ); -#endif /* HAVE_POLL */ - -#ifndef HAVE_PREAD -ssize_t pread( int fd, void *buf, size_t count, off_t offset ); -#endif /* HAVE_PREAD */ - -#ifndef HAVE_PWRITE -ssize_t pwrite( int fd, const void *buf, size_t count, off_t offset ); -#endif /* HAVE_PWRITE */ - #ifndef HAVE_READLINK int readlink( const char *path, char *buf, size_t size ); #endif /* HAVE_READLINK */ diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in index 93b28e70879..c43a542cbd4 100644 --- a/libs/port/Makefile.in +++ b/libs/port/Makefile.in @@ -4,9 +4,6 @@ C_SRCS = \ getopt.c \ lstat.c \ mkstemps.c \ - poll.c \ - pread.c \ - pwrite.c \ readlink.c \ spawn.c \ symlink.c diff --git a/libs/port/poll.c b/libs/port/poll.c deleted file mode 100644 index c499a963ac0..00000000000 --- a/libs/port/poll.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * poll function - * - * Copyright 2008 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" - -#ifndef HAVE_POLL - -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -/* we can't include winsock2.h here so we have to duplicate the definitions for Windows */ -#if defined(__MINGW32__) || defined(_MSC_VER) - -#define FD_SETSIZE 64 - -struct __ms_timeval -{ - long tv_sec; - long tv_usec; -}; -#define timeval __ms_timeval - -typedef struct -{ - unsigned int fd_count; - int fd_array[FD_SETSIZE]; /* an array of SOCKETs */ -} fd_set; - -#define FD_ZERO(set) ((set)->fd_count = 0) -#define FD_ISSET(fd, set) __WSAFDIsSet((fd), (set)) -#define FD_SET(fd, set) do { if ((set)->fd_count < FD_SETSIZE) (set)->fd_array[(set)->fd_count++]=(fd); } while(0) - -int __stdcall select(int,fd_set*,fd_set*,fd_set*,const struct timeval*); -int __stdcall __WSAFDIsSet(int,fd_set*); - -#endif - -int poll( struct pollfd *fds, unsigned int count, int timeout ) -{ - fd_set read_set, write_set, except_set; - unsigned int i; - int maxfd = -1, ret; - - FD_ZERO( &read_set ); - FD_ZERO( &write_set ); - FD_ZERO( &except_set ); - - for (i = 0; i < count; i++) - { - if (fds[i].fd == -1) continue; - if (fds[i].events & (POLLIN|POLLPRI)) FD_SET( fds[i].fd, &read_set ); - if (fds[i].events & POLLOUT) FD_SET( fds[i].fd, &write_set ); - FD_SET( fds[i].fd, &except_set ); /* POLLERR etc. are always selected */ - if (fds[i].fd > maxfd) maxfd = fds[i].fd; - } - if (timeout != -1) - { - struct timeval tv; - tv.tv_sec = timeout / 1000; - tv.tv_usec = timeout % 1000; - ret = select( maxfd + 1, &read_set, &write_set, &except_set, &tv ); - } - else ret = select( maxfd + 1, &read_set, &write_set, &except_set, NULL ); - - if (ret >= 0) - { - for (i = 0; i < count; i++) - { - fds[i].revents = 0; - if (fds[i].fd == -1) continue; - if (FD_ISSET( fds[i].fd, &read_set )) fds[i].revents |= POLLIN; - if (FD_ISSET( fds[i].fd, &write_set )) fds[i].revents |= POLLOUT; - if (FD_ISSET( fds[i].fd, &except_set )) fds[i].revents |= POLLERR; - } - } - return ret; -} - -#endif /* HAVE_POLL */ diff --git a/libs/port/pread.c b/libs/port/pread.c deleted file mode 100644 index cced41683e7..00000000000 --- a/libs/port/pread.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * pread 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 -#include -#ifdef HAVE_UNISTD_H -# include -#endif - -/* FIXME: this is not thread-safe */ - -#ifndef HAVE_PREAD -ssize_t pread( int fd, void *buf, size_t count, off_t offset ) -{ - ssize_t ret; - off_t old_pos; - - if ((old_pos = lseek( fd, 0, SEEK_CUR )) == -1) return -1; - if (lseek( fd, offset, SEEK_SET ) == -1) return -1; - if ((ret = read( fd, buf, count )) == -1) - { - int err = errno; /* save errno */ - lseek( fd, old_pos, SEEK_SET ); - errno = err; - return -1; - } - if (lseek( fd, old_pos, SEEK_SET ) == -1) return -1; - return ret; -} -#endif /* HAVE_PREAD */ diff --git a/libs/port/pwrite.c b/libs/port/pwrite.c deleted file mode 100644 index 37e5dab3b4a..00000000000 --- a/libs/port/pwrite.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * pwrite 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 -#include -#ifdef HAVE_UNISTD_H -# include -#endif - -/* FIXME: this is not thread-safe */ - -#ifndef HAVE_PWRITE -ssize_t pwrite( int fd, const void *buf, size_t count, off_t offset ) -{ - ssize_t ret; - off_t old_pos; - - if ((old_pos = lseek( fd, 0, SEEK_CUR )) == -1) return -1; - if (lseek( fd, offset, SEEK_SET ) == -1) return -1; - if ((ret = write( fd, buf, count )) == -1) - { - int err = errno; /* save errno */ - lseek( fd, old_pos, SEEK_SET ); - errno = err; - return -1; - } - if (lseek( fd, old_pos, SEEK_SET ) == -1) return -1; - return ret; -} -#endif /* HAVE_PWRITE */