configure: Hardcode some functions for Windows platforms.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-03-13 17:14:48 +01:00
parent 4d4c55d061
commit 817fb9755c
10 changed files with 16 additions and 319 deletions

56
configure vendored
View File

@ -16709,20 +16709,8 @@ CFLAGS="$CFLAGS $BUILTINFLAG"
for ac_func in \ for ac_func in \
__res_get_state \ __res_get_state \
__res_getservers \ __res_getservers \
_finite \
_isnan \
_pclose \
_popen \
_snprintf \
_spawnvp \ _spawnvp \
_strdup \
_stricmp \
_strnicmp \
_strtoi64 \
_strtoui64 \
_vsnprintf \
asctime_r \ asctime_r \
chsize \
dlopen \ dlopen \
epoll_create \ epoll_create \
ffs \ ffs \
@ -16732,7 +16720,6 @@ for ac_func in \
fpclass \ fpclass \
fstatfs \ fstatfs \
fstatvfs \ fstatvfs \
ftruncate \
futimens \ futimens \
futimes \ futimes \
futimesat \ futimesat \
@ -16745,10 +16732,8 @@ for ac_func in \
kqueue \ kqueue \
lstat \ lstat \
mmap \ mmap \
pclose \
pipe2 \ pipe2 \
poll \ poll \
popen \
port_create \ port_create \
prctl \ prctl \
pread \ pread \
@ -16764,23 +16749,16 @@ for ac_func in \
settimeofday \ settimeofday \
sigaltstack \ sigaltstack \
sigprocmask \ sigprocmask \
snprintf \
statfs \ statfs \
statvfs \ statvfs \
strcasecmp \
strdup \
strncasecmp \
strnlen \ strnlen \
strtold \ strtold \
strtoll \
strtoull \
symlink \ symlink \
sysinfo \ sysinfo \
tcdrain \ tcdrain \
thr_kill2 \ thr_kill2 \
timegm \ timegm \
usleep \ usleep
vsnprintf
do : do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@ -17328,38 +17306,6 @@ esac
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir takes only one argument" >&5
$as_echo_n "checking whether mkdir takes only one argument... " >&6; }
if ${wine_cv_one_arg_mkdir+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/stat.h>
int
main ()
{
mkdir("foo");
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
wine_cv_one_arg_mkdir=yes
else
wine_cv_one_arg_mkdir=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_one_arg_mkdir" >&5
$as_echo "$wine_cv_one_arg_mkdir" >&6; }
if test "$wine_cv_one_arg_mkdir" = "yes"
then
$as_echo "#define HAVE_ONE_ARG_MKDIR 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_setaffinity" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_setaffinity" >&5
$as_echo_n "checking for sched_setaffinity... " >&6; } $as_echo_n "checking for sched_setaffinity... " >&6; }
if ${wine_cv_have_sched_setaffinity+:} false; then : if ${wine_cv_have_sched_setaffinity+:} false; then :

View File

@ -2127,20 +2127,8 @@ CFLAGS="$CFLAGS $BUILTINFLAG"
AC_CHECK_FUNCS(\ AC_CHECK_FUNCS(\
__res_get_state \ __res_get_state \
__res_getservers \ __res_getservers \
_finite \
_isnan \
_pclose \
_popen \
_snprintf \
_spawnvp \ _spawnvp \
_strdup \
_stricmp \
_strnicmp \
_strtoi64 \
_strtoui64 \
_vsnprintf \
asctime_r \ asctime_r \
chsize \
dlopen \ dlopen \
epoll_create \ epoll_create \
ffs \ ffs \
@ -2150,7 +2138,6 @@ AC_CHECK_FUNCS(\
fpclass \ fpclass \
fstatfs \ fstatfs \
fstatvfs \ fstatvfs \
ftruncate \
futimens \ futimens \
futimes \ futimes \
futimesat \ futimesat \
@ -2163,10 +2150,8 @@ AC_CHECK_FUNCS(\
kqueue \ kqueue \
lstat \ lstat \
mmap \ mmap \
pclose \
pipe2 \ pipe2 \
poll \ poll \
popen \
port_create \ port_create \
prctl \ prctl \
pread \ pread \
@ -2182,23 +2167,16 @@ AC_CHECK_FUNCS(\
settimeofday \ settimeofday \
sigaltstack \ sigaltstack \
sigprocmask \ sigprocmask \
snprintf \
statfs \ statfs \
statvfs \ statvfs \
strcasecmp \
strdup \
strncasecmp \
strnlen \ strnlen \
strtold \ strtold \
strtoll \
strtoull \
symlink \ symlink \
sysinfo \ sysinfo \
tcdrain \ tcdrain \
thr_kill2 \ thr_kill2 \
timegm \ timegm \
usleep \ usleep
vsnprintf
) )
CFLAGS="$ac_save_CFLAGS" CFLAGS="$ac_save_CFLAGS"
@ -2282,15 +2260,6 @@ fi
WINE_NOTICE_WITH(ldap,[test "x$LDAP_LIBS" = "x"], WINE_NOTICE_WITH(ldap,[test "x$LDAP_LIBS" = "x"],
[libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported.]) [libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported.])
AC_CACHE_CHECK([whether mkdir takes only one argument],
wine_cv_one_arg_mkdir,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]],[[mkdir("foo");]])],
[wine_cv_one_arg_mkdir=yes],[wine_cv_one_arg_mkdir=no]))
if test "$wine_cv_one_arg_mkdir" = "yes"
then
AC_DEFINE(HAVE_ONE_ARG_MKDIR, 1, [Define if mkdir takes only one argument])
fi
AC_CACHE_CHECK([for sched_setaffinity],wine_cv_have_sched_setaffinity, AC_CACHE_CHECK([for sched_setaffinity],wine_cv_have_sched_setaffinity,
AC_LINK_IFELSE([AC_LANG_PROGRAM( AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#define _GNU_SOURCE [[#define _GNU_SOURCE

View File

@ -80,9 +80,6 @@
/* Define to 1 if you have the `cbrtf' function. */ /* Define to 1 if you have the `cbrtf' function. */
#undef HAVE_CBRTF #undef HAVE_CBRTF
/* Define to 1 if you have the `chsize' function. */
#undef HAVE_CHSIZE
/* Define to 1 if you have the `clock_gettime' function. */ /* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME #undef HAVE_CLOCK_GETTIME
@ -207,9 +204,6 @@
/* Define to 1 if you have the <ft2build.h> header file. */ /* Define to 1 if you have the <ft2build.h> header file. */
#undef HAVE_FT2BUILD_H #undef HAVE_FT2BUILD_H
/* Define to 1 if you have the `ftruncate' function. */
#undef HAVE_FTRUNCATE
/* Define to 1 if the system has the type `FT_TrueTypeEngineType'. */ /* Define to 1 if the system has the type `FT_TrueTypeEngineType'. */
#undef HAVE_FT_TRUETYPEENGINETYPE #undef HAVE_FT_TRUETYPEENGINETYPE
@ -693,9 +687,6 @@
/* Define to 1 if `_msg_ptr' is a member of `ns_msg'. */ /* Define to 1 if `_msg_ptr' is a member of `ns_msg'. */
#undef HAVE_NS_MSG__MSG_PTR #undef HAVE_NS_MSG__MSG_PTR
/* Define if mkdir takes only one argument */
#undef HAVE_ONE_ARG_MKDIR
/* Define to 1 if OpenAL is available */ /* Define to 1 if OpenAL is available */
#undef HAVE_OPENAL #undef HAVE_OPENAL
@ -711,9 +702,6 @@
/* Define to 1 if you have the <pcap/pcap.h> header file. */ /* Define to 1 if you have the <pcap/pcap.h> header file. */
#undef HAVE_PCAP_PCAP_H #undef HAVE_PCAP_PCAP_H
/* Define to 1 if you have the `pclose' function. */
#undef HAVE_PCLOSE
/* Define to 1 if you have the `pipe2' function. */ /* Define to 1 if you have the `pipe2' function. */
#undef HAVE_PIPE2 #undef HAVE_PIPE2
@ -726,9 +714,6 @@
/* Define to 1 if you have the <poll.h> header file. */ /* Define to 1 if you have the <poll.h> header file. */
#undef HAVE_POLL_H #undef HAVE_POLL_H
/* Define to 1 if you have the `popen' function. */
#undef HAVE_POPEN
/* Define to 1 if you have the `port_create' function. */ /* Define to 1 if you have the `port_create' function. */
#undef HAVE_PORT_CREATE #undef HAVE_PORT_CREATE
@ -879,9 +864,6 @@
/* Define to 1 if the system has the type `sigset_t'. */ /* Define to 1 if the system has the type `sigset_t'. */
#undef HAVE_SIGSET_T #undef HAVE_SIGSET_T
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the `socketpair' function. */ /* Define to 1 if you have the `socketpair' function. */
#undef HAVE_SOCKETPAIR #undef HAVE_SOCKETPAIR
@ -903,21 +885,12 @@
/* Define to 1 if you have the <stdlib.h> header file. */ /* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H #undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the <strings.h> header file. */ /* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H #undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */ /* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H #undef HAVE_STRING_H
/* Define to 1 if you have the `strncasecmp' function. */
#undef HAVE_STRNCASECMP
/* Define to 1 if you have the `strnlen' function. */ /* Define to 1 if you have the `strnlen' function. */
#undef HAVE_STRNLEN #undef HAVE_STRNLEN
@ -927,12 +900,6 @@
/* Define to 1 if you have the `strtold' function. */ /* Define to 1 if you have the `strtold' function. */
#undef HAVE_STRTOLD #undef HAVE_STRTOLD
/* Define to 1 if you have the `strtoll' function. */
#undef HAVE_STRTOLL
/* Define to 1 if you have the `strtoull' function. */
#undef HAVE_STRTOULL
/* Define to 1 if `d_reclen' is a member of `struct dirent'. */ /* Define to 1 if `d_reclen' is a member of `struct dirent'. */
#undef HAVE_STRUCT_DIRENT_D_RECLEN #undef HAVE_STRUCT_DIRENT_D_RECLEN
@ -1269,9 +1236,6 @@
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */ /* Define to 1 if you have the <valgrind/valgrind.h> header file. */
#undef HAVE_VALGRIND_VALGRIND_H #undef HAVE_VALGRIND_VALGRIND_H
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Define to 1 if you have the <X11/extensions/shape.h> header file. */ /* Define to 1 if you have the <X11/extensions/shape.h> header file. */
#undef HAVE_X11_EXTENSIONS_SHAPE_H #undef HAVE_X11_EXTENSIONS_SHAPE_H
@ -1368,42 +1332,9 @@
/* Define to 1 if you have the <zlib.h> header file. */ /* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H #undef HAVE_ZLIB_H
/* Define to 1 if you have the `_finite' function. */
#undef HAVE__FINITE
/* Define to 1 if you have the `_isnan' function. */
#undef HAVE__ISNAN
/* Define to 1 if you have the `_pclose' function. */
#undef HAVE__PCLOSE
/* Define to 1 if you have the `_popen' function. */
#undef HAVE__POPEN
/* Define to 1 if you have the `_snprintf' function. */
#undef HAVE__SNPRINTF
/* Define to 1 if you have the `_spawnvp' function. */ /* Define to 1 if you have the `_spawnvp' function. */
#undef HAVE__SPAWNVP #undef HAVE__SPAWNVP
/* Define to 1 if you have the `_strdup' function. */
#undef HAVE__STRDUP
/* Define to 1 if you have the `_stricmp' function. */
#undef HAVE__STRICMP
/* Define to 1 if you have the `_strnicmp' function. */
#undef HAVE__STRNICMP
/* Define to 1 if you have the `_strtoi64' function. */
#undef HAVE__STRTOI64
/* Define to 1 if you have the `_strtoui64' function. */
#undef HAVE__STRTOUI64
/* Define to 1 if you have the `_vsnprintf' function. */
#undef HAVE__VSNPRINTF
/* Define to 1 if you have the `__builtin_clz' built-in function. */ /* Define to 1 if you have the `__builtin_clz' built-in function. */
#undef HAVE___BUILTIN_CLZ #undef HAVE___BUILTIN_CLZ

View File

@ -53,8 +53,22 @@
#include <io.h> #include <io.h>
#include <process.h> #include <process.h>
#define mkdir(path,mode) mkdir(path)
#ifdef _MSC_VER #ifdef _MSC_VER
#define ftruncate chsize
#define isfinite(x) _finite(x)
#define isinf(x) (!(_finite(x) || _isnan(x)))
#define isnan(x) _isnan(x)
#define popen _popen
#define pclose _pclose
#define snprintf _snprintf
#define strtoll _strtoi64
#define strtoull _strtoui64
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
typedef int mode_t; typedef int mode_t;
typedef long off_t; typedef long off_t;
typedef int pid_t; typedef int pid_t;
@ -115,42 +129,6 @@ struct statvfs
#define RTLD_GLOBAL 0x100 #define RTLD_GLOBAL 0x100
#endif #endif
#ifdef HAVE_ONE_ARG_MKDIR
#define mkdir(path,mode) mkdir(path)
#endif
#if !defined(HAVE_FTRUNCATE) && defined(HAVE_CHSIZE)
#define ftruncate chsize
#endif
#if !defined(HAVE_POPEN) && defined(HAVE__POPEN)
#define popen _popen
#endif
#if !defined(HAVE_PCLOSE) && defined(HAVE__PCLOSE)
#define pclose _pclose
#endif
#if !defined(HAVE_STRDUP) && defined(HAVE__STRDUP)
#define strdup _strdup
#endif
#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
#define snprintf _snprintf
#endif
#if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
#define vsnprintf _vsnprintf
#endif
#if !defined(HAVE_STRTOLL) && defined(HAVE__STRTOI64)
#define strtoll _strtoi64
#endif
#if !defined(HAVE_STRTOULL) && defined(HAVE__STRTOUI64)
#define strtoull _strtoui64
#endif
#ifndef S_ISLNK #ifndef S_ISLNK
# define S_ISLNK(mod) (0) # define S_ISLNK(mod) (0)
#endif #endif
@ -331,26 +309,10 @@ float rintf(float x);
int statvfs( const char *path, struct statvfs *buf ); int statvfs( const char *path, struct statvfs *buf );
#endif #endif
#ifndef HAVE_STRNCASECMP
# ifndef HAVE__STRNICMP
int strncasecmp(const char *str1, const char *str2, size_t n);
# else
# define strncasecmp _strnicmp
# endif
#endif /* !defined(HAVE_STRNCASECMP) */
#ifndef HAVE_STRNLEN #ifndef HAVE_STRNLEN
size_t strnlen( const char *str, size_t maxlen ); size_t strnlen( const char *str, size_t maxlen );
#endif /* !defined(HAVE_STRNLEN) */ #endif /* !defined(HAVE_STRNLEN) */
#ifndef HAVE_STRCASECMP
# ifndef HAVE__STRICMP
int strcasecmp(const char *str1, const char *str2);
# else
# define strcasecmp _stricmp
# endif
#endif /* !defined(HAVE_STRCASECMP) */
#ifndef HAVE_SYMLINK #ifndef HAVE_SYMLINK
int symlink(const char *from, const char *to); int symlink(const char *from, const char *to);
#endif #endif
@ -516,10 +478,7 @@ extern __int64 interlocked_cmpxchg64( __int64 *dest, __int64 xchg, __int64 compa
#define lstat __WINE_NOT_PORTABLE(lstat) #define lstat __WINE_NOT_PORTABLE(lstat)
#define pread __WINE_NOT_PORTABLE(pread) #define pread __WINE_NOT_PORTABLE(pread)
#define pwrite __WINE_NOT_PORTABLE(pwrite) #define pwrite __WINE_NOT_PORTABLE(pwrite)
#define spawnvp __WINE_NOT_PORTABLE(spawnvp)
#define statvfs __WINE_NOT_PORTABLE(statvfs) #define statvfs __WINE_NOT_PORTABLE(statvfs)
#define strcasecmp __WINE_NOT_PORTABLE(strcasecmp)
#define strncasecmp __WINE_NOT_PORTABLE(strncasecmp)
#define strnlen __WINE_NOT_PORTABLE(strnlen) #define strnlen __WINE_NOT_PORTABLE(strnlen)
#define usleep __WINE_NOT_PORTABLE(usleep) #define usleep __WINE_NOT_PORTABLE(usleep)

View File

@ -98,8 +98,6 @@ C_SRCS = \
rint.c \ rint.c \
spawn.c \ spawn.c \
statvfs.c \ statvfs.c \
strcasecmp.c \
strncasecmp.c \
strnlen.c \ strnlen.c \
symlink.c \ symlink.c \
usleep.c \ usleep.c \

View File

@ -31,14 +31,6 @@ int isfinite(double x)
return finite(x); return finite(x);
} }
#elif defined(HAVE_FLOAT_H) && defined(HAVE__FINITE)
#include <float.h>
int isfinite(double x)
{
return _finite(x);
}
#else #else
#error No isfinite() implementation available. #error No isfinite() implementation available.
#endif #endif

View File

@ -31,14 +31,6 @@ int isinf(double x)
return (!(finite(x) || isnand(x))); return (!(finite(x) || isnand(x)));
} }
#elif defined(HAVE_FLOAT_H) && defined(HAVE__ISNAN) && defined(HAVE__FINITE)
#include <float.h>
int isinf(double x)
{
return (!(_finite(x) || _isnan(x)));
}
#else #else
#error No isinf() implementation available. #error No isinf() implementation available.
#endif #endif

View File

@ -31,14 +31,6 @@ int isnan(double x)
return isnand(x); return isnand(x);
} }
#elif defined(HAVE_FLOAT_H) && defined(HAVE__ISNAN)
#include <float.h>
int isnan(double x)
{
return _isnan(x);
}
#else #else
#error No isnan() implementation available. #error No isnan() implementation available.
#endif #endif

View File

@ -1,39 +0,0 @@
/*
* strcasecmp 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 <ctype.h>
#ifndef HAVE_STRCASECMP
#undef strcasecmp
int strcasecmp( const char *str1, const char *str2 )
{
const unsigned char *ustr1 = (const unsigned char *)str1;
const unsigned char *ustr2 = (const unsigned char *)str2;
while (*ustr1 && toupper(*ustr1) == toupper(*ustr2)) {
ustr1++;
ustr2++;
}
return toupper(*ustr1) - toupper(*ustr2);
}
#endif /* HAVE_STRCASECMP */

View File

@ -1,43 +0,0 @@
/*
* strncasecmp 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 <ctype.h>
#ifndef HAVE_STRNCASECMP
#undef strncasecmp
int strncasecmp( const char *str1, const char *str2, size_t n )
{
const unsigned char *ustr1 = (const unsigned char *)str1;
const unsigned char *ustr2 = (const unsigned char *)str2;
int res;
if (!n) return 0;
while ((--n > 0) && *ustr1)
{
if ((res = toupper(*ustr1) - toupper(*ustr2))) return res;
ustr1++;
ustr2++;
}
return toupper(*ustr1) - toupper(*ustr2);
}
#endif /* HAVE_STRNCASECMP */