Commit 2bc3c846 authored by Alexandre Julliard's avatar Alexandre Julliard

libport: Remove the isfinite/isinf/isnan function replacements.

parent 7b4e10c7
......@@ -328,6 +328,40 @@ static inline GLenum wined3d_gl_min_mip_filter(enum wined3d_texture_filter_type
return minMipLookup[min_filter].mip[mip_filter];
}
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
#if !defined(HAVE_ISFINITE) && !defined(isfinite)
static inline int isfinite(double x) { return finite(x); }
#endif
#if !defined(HAVE_ISINF) && !defined(isinf)
static inline int isinf(double x) { return (!(finite(x) || isnand(x))); }
#endif
#if !defined(HAVE_ISNAN) && !defined(isnan)
static inline int isnan(double x) { return isnand(x); }
#endif
#ifndef INFINITY
static inline float __port_infinity(void)
{
static const unsigned __inf_bytes = 0x7f800000;
return *(const float *)&__inf_bytes;
}
#define INFINITY __port_infinity()
#endif
#ifndef NAN
static inline float __port_nan(void)
{
static const unsigned __nan_bytes = 0x7fc00000;
return *(const float *)&__nan_bytes;
}
#define NAN __port_nan()
#endif
/* float_16_to_32() and float_32_to_16() (see implementation in
* surface_base.c) convert 16 bit floats in the FLOAT16 data type
* to standard C floats and vice versa. They do not depend on the encoding
......
......@@ -63,15 +63,6 @@ static inline const char *dlerror(void) { return "No dlopen support on Windows";
#ifdef _MSC_VER
#define ftruncate chsize
#ifndef isfinite
# define isfinite(x) _finite(x)
#endif
#ifndef isinf
# define isinf(x) (!(_finite(x) || _isnan(x)))
#endif
#ifndef isnan
# define isnan(x) _isnan(x)
#endif
#define popen _popen
#define pclose _pclose
/* The UCRT headers in the Windows SDK #error out if we #define snprintf.
......@@ -103,18 +94,6 @@ typedef int ssize_t;
# endif
#endif
#ifndef HAVE_ISFINITE
int isfinite(double x);
#endif
#ifndef HAVE_ISINF
int isinf(double x);
#endif
#ifndef HAVE_ISNAN
int isnan(double x);
#endif
/* Process creation flags */
#ifndef _P_WAIT
# define _P_WAIT 0
......@@ -191,24 +170,6 @@ extern int _spawnvp(int mode, const char *cmdname, const char * const argv[]);
#define M_PI_2 1.570796326794896619
#endif
#ifndef INFINITY
static inline float __port_infinity(void)
{
static const unsigned __inf_bytes = 0x7f800000;
return *(const float *)&__inf_bytes;
}
#define INFINITY __port_infinity()
#endif
#ifndef NAN
static inline float __port_nan(void)
{
static const unsigned __nan_bytes = 0x7fc00000;
return *(const float *)&__nan_bytes;
}
#define NAN __port_nan()
#endif
/****************************************************************
* Function definitions (only when using libwine_port)
......
......@@ -2,9 +2,6 @@ STATICLIB = libwine_port.a
C_SRCS = \
getopt.c \
isfinite.c \
isinf.c \
isnan.c \
lstat.c \
mkstemps.c \
poll.c \
......
/*
* isfinite function
*
* Copyright 2013 Francois Gouget
*
* 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"
#if !defined(HAVE_ISFINITE) && !defined(isfinite)
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
int isfinite(double x)
{
return finite(x);
}
#else
#error No isfinite() implementation available.
#endif
#endif /* HAVE_ISFINITE */
/*
* isinf function
*
* Copyright 2008 Petr Sumbera
*
* 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"
#if !defined(HAVE_ISINF) && !defined(isinf)
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
int isinf(double x)
{
return (!(finite(x) || isnand(x)));
}
#else
#error No isinf() implementation available.
#endif
#endif /* HAVE_ISINF */
/*
* isnan function
*
* Copyright 2008 Jacek Caban for CodeWeavers
*
* 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"
#if !defined(HAVE_ISNAN) && !defined(isnan)
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
int isnan(double x)
{
return isnand(x);
}
#else
#error No isnan() implementation available.
#endif
#endif /* HAVE_ISNAN */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment