Portability fixes for LSB compatibility.

This commit is contained in:
Alexandre Julliard 2004-03-01 21:32:02 +00:00
parent 93e268efbd
commit e8a339c1d2
13 changed files with 60 additions and 49 deletions

2
configure vendored
View File

@ -15819,6 +15819,7 @@ done
for ac_header in \
@ -15839,6 +15840,7 @@ for ac_header in \
linux/cdrom.h \
linux/hdreg.h \
linux/input.h \
linux/ioctl.h \
linux/joystick.h \
linux/major.h \
linux/param.h \

View File

@ -1078,6 +1078,7 @@ AC_CHECK_HEADERS(\
linux/cdrom.h \
linux/hdreg.h \
linux/input.h \
linux/ioctl.h \
linux/joystick.h \
linux/major.h \
linux/param.h \

View File

@ -146,7 +146,7 @@ void vshader_lit(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
void vshader_logp(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
float tmp_f = fabsf(s0->w);
d->x = d->y = d->z = d->w = (0.0f != tmp_f) ? logf(tmp_f) / logf(2.0f) : -HUGE;
d->x = d->y = d->z = d->w = (0.0f != tmp_f) ? logf(tmp_f) / logf(2.0f) : -HUGE_VAL;
VSTRACE(("executing logp: s0=(%f, %f, %f, %f) => d=(%f, %f, %f, %f)\n",
s0->x, s0->y, s0->z, s0->w, d->x, d->y, d->z, d->w));
}
@ -201,14 +201,14 @@ void vshader_nop(void) {
}
void vshader_rcp(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
d->x = d->y = d->z = d->w = (0.0f == s0->w) ? HUGE : 1.0f / s0->w;
d->x = d->y = d->z = d->w = (0.0f == s0->w) ? HUGE_VAL : 1.0f / s0->w;
VSTRACE(("executing rcp: s0=(%f, %f, %f, %f) => d=(%f, %f, %f, %f)\n",
s0->x, s0->y, s0->z, s0->w, d->x, d->y, d->z, d->w));
}
void vshader_rsq(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
float tmp_f = fabsf(s0->w);
d->x = d->y = d->z = d->w = (0.0f == tmp_f) ? HUGE : ((1.0f != tmp_f) ? 1.0f / sqrtf(tmp_f) : 1.0f);
d->x = d->y = d->z = d->w = (0.0f == tmp_f) ? HUGE_VAL : ((1.0f != tmp_f) ? 1.0f / sqrtf(tmp_f) : 1.0f);
VSTRACE(("executing rsq: s0=(%f, %f, %f, %f) => d=(%f, %f, %f, %f)\n",
s0->x, s0->y, s0->z, s0->w, d->x, d->y, d->z, d->w));
}
@ -252,7 +252,7 @@ void vshader_exp(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
void vshader_log(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
float tmp_f = fabsf(s0->w);
d->x = d->y = d->z = d->w = (0.0f != tmp_f) ? logf(tmp_f) / logf(2.0f) : -HUGE;
d->x = d->y = d->z = d->w = (0.0f != tmp_f) ? logf(tmp_f) / logf(2.0f) : -HUGE_VAL;
VSTRACE(("executing log: s0=(%f, %f, %f, %f) => d=(%f, %f, %f, %f)\n",
s0->x, s0->y, s0->z, s0->w, d->x, d->y, d->z, d->w));
}

View File

@ -42,6 +42,9 @@
#ifdef HAVE_SYS_ERRNO_H
# include <sys/errno.h>
#endif
#ifdef HAVE_LINUX_IOCTL_H
# include <linux/ioctl.h>
#endif
#ifdef HAVE_LINUX_JOYSTICK_H
# include <linux/joystick.h>
#endif

View File

@ -53,38 +53,18 @@
#include "ifenum.h"
#include "ipstats.h"
#ifndef TCPS_ESTABLISHED
# define TCPS_ESTABLISHED TCP_ESTABLISHED
#endif
#ifndef TCPS_SYN_SENT
# define TCPS_SYN_SENT TCP_SYN_SENT
#endif
#ifndef TCPS_SYN_RECEIVED
# define TCPS_SYN_RECEIVED TCP_SYN_RECV
#endif
#ifndef TCPS_FIN_WAIT_1
# define TCPS_FIN_WAIT_1 TCP_FIN_WAIT1
#endif
#ifndef TCPS_FIN_WAIT_2
# define TCPS_FIN_WAIT_2 TCP_FIN_WAIT2
#endif
#ifndef TCPS_TIME_WAIT
# define TCPS_TIME_WAIT TCP_TIME_WAIT
#endif
#ifndef TCPS_CLOSED
# define TCPS_CLOSED TCP_CLOSE
#endif
#ifndef TCPS_CLOSE_WAIT
# define TCPS_CLOSE_WAIT TCP_CLOSE_WAIT
#endif
#ifndef TCPS_LAST_ACK
# define TCPS_LAST_ACK TCP_LAST_ACK
#endif
#ifndef TCPS_LISTEN
# define TCPS_LISTEN TCP_LISTEN
#endif
#ifndef TCPS_CLOSING
# define TCPS_CLOSING TCP_CLOSING
#ifdef linux
#define TCPS_ESTABLISHED 1
#define TCPS_SYN_SENT 2
#define TCPS_SYN_RECEIVED 3
#define TCPS_FIN_WAIT_1 4
#define TCPS_FIN_WAIT_2 5
#define TCPS_TIME_WAIT 6
#define TCPS_CLOSED 7
#define TCPS_CLOSE_WAIT 8
#define TCPS_LAST_ACK 9
#define TCPS_LISTEN 10
#define TCPS_CLOSING 11
#endif
DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry)

View File

@ -68,9 +68,9 @@
#include "config.h"
#include <stdarg.h>
#include "winsock2.h"
#include "windef.h"
#include "winbase.h"
#include "winsock2.h"
#include "wine/debug.h"
#include "winreg.h"
#include "iphlpapi.h"

View File

@ -140,7 +140,7 @@ void vshader_lit(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
void vshader_logp(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
float tmp_f = fabsf(s0->w);
d->x = d->y = d->z = d->w = (0.0f != tmp_f) ? logf(tmp_f) / logf(2.0f) : -HUGE;
d->x = d->y = d->z = d->w = (0.0f != tmp_f) ? logf(tmp_f) / logf(2.0f) : -HUGE_VAL;
VSTRACE(("executing logp: s0=(%f, %f, %f, %f) => d=(%f, %f, %f, %f)\n",
s0->x, s0->y, s0->z, s0->w, d->x, d->y, d->z, d->w));
}
@ -195,14 +195,14 @@ void vshader_nop(void) {
}
void vshader_rcp(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
d->x = d->y = d->z = d->w = (0.0f == s0->w) ? HUGE : 1.0f / s0->w;
d->x = d->y = d->z = d->w = (0.0f == s0->w) ? HUGE_VAL : 1.0f / s0->w;
VSTRACE(("executing rcp: s0=(%f, %f, %f, %f) => d=(%f, %f, %f, %f)\n",
s0->x, s0->y, s0->z, s0->w, d->x, d->y, d->z, d->w));
}
void vshader_rsq(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
float tmp_f = fabsf(s0->w);
d->x = d->y = d->z = d->w = (0.0f == tmp_f) ? HUGE : ((1.0f != tmp_f) ? 1.0f / sqrtf(tmp_f) : 1.0f);
d->x = d->y = d->z = d->w = (0.0f == tmp_f) ? HUGE_VAL : ((1.0f != tmp_f) ? 1.0f / sqrtf(tmp_f) : 1.0f);
VSTRACE(("executing rsq: s0=(%f, %f, %f, %f) => d=(%f, %f, %f, %f)\n",
s0->x, s0->y, s0->z, s0->w, d->x, d->y, d->z, d->w));
}
@ -246,7 +246,7 @@ void vshader_exp(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
void vshader_log(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0) {
float tmp_f = fabsf(s0->w);
d->x = d->y = d->z = d->w = (0.0f != tmp_f) ? logf(tmp_f) / logf(2.0f) : -HUGE;
d->x = d->y = d->z = d->w = (0.0f != tmp_f) ? logf(tmp_f) / logf(2.0f) : -HUGE_VAL;
VSTRACE(("executing log: s0=(%f, %f, %f, %f) => d=(%f, %f, %f, %f)\n",
s0->x, s0->y, s0->z, s0->w, d->x, d->y, d->z, d->w));
}

View File

@ -29,10 +29,13 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#include <errno.h>
#ifdef HAVE_LINUX_IOCTL_H
# include <linux/ioctl.h>
#endif
#include <linux/ppdev.h>
#include "winerror.h"

View File

@ -45,6 +45,9 @@
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#ifdef HAVE_LINUX_IOCTL_H
#include <linux/ioctl.h>
#endif
#ifdef HAVE_LINUX_JOYSTICK_H
#include <linux/joystick.h>
#define JOYDEV "/dev/js%d"

View File

@ -1823,7 +1823,6 @@ int WINAPI WS_ioctlsocket(SOCKET s, long cmd, u_long *argp)
break;
case WS_FIONBIO:
newcmd=FIONBIO;
if( _get_sock_mask(s) )
{
/* AsyncSelect()'ed sockets are always nonblocking */
@ -1831,11 +1830,25 @@ int WINAPI WS_ioctlsocket(SOCKET s, long cmd, u_long *argp)
SetLastError(WSAEINVAL);
return SOCKET_ERROR;
}
if (*argp)
_enable_event(SOCKET2HANDLE(s), 0, FD_WINE_NONBLOCKING, 0);
else
_enable_event(SOCKET2HANDLE(s), 0, 0, FD_WINE_NONBLOCKING);
return 0;
fd = get_sock_fd( s, 0, NULL );
if (fd != -1)
{
int ret;
if (*argp)
{
_enable_event(SOCKET2HANDLE(s), 0, FD_WINE_NONBLOCKING, 0);
ret = fcntl( fd, F_SETFL, O_NONBLOCK );
}
else
{
_enable_event(SOCKET2HANDLE(s), 0, 0, FD_WINE_NONBLOCKING);
ret = fcntl( fd, F_SETFL, 0 );
}
release_sock_fd( s, fd );
if (!ret) return 0;
SetLastError((errno == EBADF) ? WSAENOTSOCK : wsaErrno());
}
return SOCKET_ERROR;
case WS_SIOCATMARK:
newcmd=SIOCATMARK;

View File

@ -37,6 +37,9 @@
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#ifdef HAVE_LINUX_IOCTL_H
#include <linux/ioctl.h>
#endif
#include <time.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>

View File

@ -308,6 +308,9 @@
/* Define to 1 if you have the <linux/input.h> header file. */
#undef HAVE_LINUX_INPUT_H
/* Define to 1 if you have the <linux/ioctl.h> header file. */
#undef HAVE_LINUX_IOCTL_H
/* Define to 1 if you have the <linux/joystick.h> header file. */
#undef HAVE_LINUX_JOYSTICK_H

View File

@ -79,7 +79,7 @@ static struct list change_list = LIST_INIT(change_list);
static void adjust_changes( int fd, unsigned int filter )
{
#ifdef F_NOTIFY
#if defined(F_SETSIG) && defined(F_NOTIFY)
unsigned int val;
if ( 0 > fcntl( fd, F_SETSIG, SIGIO) )
return;