summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2020-05-31 16:06:07 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2020-05-31 17:09:23 +0200
commit2d5cf2b4c4b11b2df01363133be80fe25b79252d (patch)
treeb393eeb50596ffbfbb5f106626e4d4eecfe36917 /gdk
parentc5829bd0e2134ed9f05fe9d6fbe1f3156a00352e (diff)
downloadgtk+-2d5cf2b4c4b11b2df01363133be80fe25b79252d.tar.gz
Drop fallback-c89.c
We require a C compiler supporting C99 now. The main purpose of these fallbacks was for MSVC. From what I can see this is now all supported by MSVC 2015+ anyway. The only other change this includes is to replace isnanf() with the (type infering) C99 isnan() macro, because MSVC doesn't provide isnanf().
Diffstat (limited to 'gdk')
-rw-r--r--gdk/fallback-c89.c58
-rw-r--r--gdk/gdkdevice.c3
-rw-r--r--gdk/gdkdisplay.c3
-rw-r--r--gdk/gdkrgba.c2
-rw-r--r--gdk/gdksurface.c3
-rw-r--r--gdk/win32/gdksurface-win32.c1
6 files changed, 0 insertions, 70 deletions
diff --git a/gdk/fallback-c89.c b/gdk/fallback-c89.c
deleted file mode 100644
index e9adc5eba8..0000000000
--- a/gdk/fallback-c89.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 2011 Chun-wei Fan <fanc999@yahoo.com.tw>
- *
- * Author: Chun-wei Fan <fanc999@yahoo.com.tw>
- *
- * 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 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include "config.h"
-
-#include <float.h>
-
-#ifndef HAVE_DECL_ISNAN
-/* it seems of the supported compilers only
- * MSVC does not have isnan(), but it does
- * have _isnan() which does the same as isnan()
- */
-static inline gboolean
-isnan (double x)
-{
- return _isnan (x);
-}
-#endif
-
-#ifndef HAVE_DECL_ISINF
-/* Unfortunately MSVC does not have finite()
- * but it does have _finite() which is the same
- * as finite() except when x is a NaN
- */
-static inline gboolean
-isinf (double x)
-{
- return (!_finite (x) && !_isnan (x));
-}
-#endif
-
-/* Workaround for round() for non-GCC/non-C99 compilers */
-#ifndef HAVE_ROUND
-static inline double
-round (double x)
-{
- if (x >= 0)
- return floor (x + 0.5);
- else
- return ceil (x - 0.5);
-}
-#endif
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 11823ec919..98cbd8806b 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -26,9 +26,6 @@
#include "gdkintl.h"
#include "gdkkeysprivate.h"
-/* for the use of round() */
-#include "fallback-c89.c"
-
/**
* SECTION:gdkdevice
* @Short_description: Object representing an input device
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 81277b9f7b..9e6853391d 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -38,9 +38,6 @@
#include <math.h>
#include <glib.h>
-/* for the use of round() */
-#include "fallback-c89.c"
-
/**
* SECTION:gdkdisplay
* @Short_description: Controls a set of monitors and their associated input devices
diff --git a/gdk/gdkrgba.c b/gdk/gdkrgba.c
index 0242e8f945..b8bd025d3b 100644
--- a/gdk/gdkrgba.c
+++ b/gdk/gdkrgba.c
@@ -30,8 +30,6 @@
#include <errno.h>
#include <math.h>
-#include "fallback-c89.c"
-
/**
* SECTION:rgba_colors
* @Short_description: RGBA colors
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index f0ef1eeb8e..1c5aeb180a 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -47,9 +47,6 @@
#include <epoxy/gl.h>
-/* for the use of round() */
-#include "fallback-c89.c"
-
#ifdef GDK_WINDOWING_WAYLAND
#include "wayland/gdkwayland.h"
#endif
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index d26b64ebd2..5edb59e9a8 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -49,7 +49,6 @@
#include <cairo-win32.h>
#include <dwmapi.h>
#include <math.h>
-#include "fallback-c89.c"
static void gdk_surface_win32_finalize (GObject *object);