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

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


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

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

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

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

---

 dlls/wined3d/wined3d_private.h | 34 ++++++++++++++++++++++++++++++++++
 include/wine/port.h            | 39 ---------------------------------------
 libs/port/Makefile.in          |  3 ---
 libs/port/isfinite.c           | 38 --------------------------------------
 libs/port/isinf.c              | 38 --------------------------------------
 libs/port/isnan.c              | 38 --------------------------------------
 6 files changed, 34 insertions(+), 156 deletions(-)

diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index a7baff857d0..52efe685d71 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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
diff --git a/include/wine/port.h b/include/wine/port.h
index 936f69d3bde..fec72120ec6 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -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)
diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in
index 764a56f62ae..93b28e70879 100644
--- a/libs/port/Makefile.in
+++ b/libs/port/Makefile.in
@@ -2,9 +2,6 @@ STATICLIB = libwine_port.a
 
 C_SRCS = \
 	getopt.c \
-	isfinite.c \
-	isinf.c \
-	isnan.c \
 	lstat.c \
 	mkstemps.c \
 	poll.c \
diff --git a/libs/port/isfinite.c b/libs/port/isfinite.c
deleted file mode 100644
index b1ce304b2db..00000000000
--- a/libs/port/isfinite.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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 */
diff --git a/libs/port/isinf.c b/libs/port/isinf.c
deleted file mode 100644
index 89f62c90e61..00000000000
--- a/libs/port/isinf.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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 */
diff --git a/libs/port/isnan.c b/libs/port/isnan.c
deleted file mode 100644
index e98875c8ee1..00000000000
--- a/libs/port/isnan.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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 */




More information about the wine-cvs mailing list