[gtk/drop-fallback-c89: 2/2] Drop fallback-c89.c



commit 3c0bab1af54af63e55631937faa342d0c21c2628
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Sun May 31 16:06:07 2020 +0200

    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().

 config.h.meson                    |  27 --------
 gdk/fallback-c89.c                |  58 ----------------
 gdk/gdkdevice.c                   |   3 -
 gdk/gdkdisplay.c                  |   3 -
 gdk/gdkrgba.c                     |   2 -
 gdk/gdksurface.c                  |   3 -
 gdk/win32/gdksurface-win32.c      |   1 -
 gtk/fallback-c89.c                | 140 --------------------------------------
 gtk/gtkcssshorthandpropertyimpl.c |   5 --
 gtk/gtkcssstyleproperty.c         |   5 --
 gtk/gtkcssstylepropertyimpl.c     |   5 --
 gtk/gtkentry.c                    |   2 -
 gtk/gtkicontheme.c                |   5 --
 gtk/gtkkineticscrolling.c         |   2 -
 gtk/gtklabel.c                    |   5 --
 gtk/gtklevelbar.c                 |   2 -
 gtk/gtknumericsorter.c            |   7 +-
 gtk/gtkprogressbar.c              |   2 -
 gtk/gtkrender.c                   |   2 -
 gtk/gtkrenderbackground.c         |   5 --
 gtk/gtkrenderborder.c             |   5 --
 gtk/gtkrevealer.c                 |   2 -
 gtk/gtkswitch.c                   |   2 -
 gtk/gtktext.c                     |   2 -
 gtk/gtkwidget.c                   |   3 -
 gtk/inspector/visual.c            |   2 -
 gtk/meson.build                   |   1 -
 meson.build                       |   9 ---
 28 files changed, 3 insertions(+), 307 deletions(-)
---
diff --git a/config.h.meson b/config.h.meson
index fac759a2a7..ee5ddbf7b3 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -27,18 +27,6 @@
 /* Define to 1 if you have the `dcgettext' function. */
 #mesondefine HAVE_DCGETTEXT
 
-/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
-   */
-#mesondefine HAVE_DECL_ISINF
-
-/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
-   */
-#mesondefine HAVE_DECL_ISNAN
-
-/* Define to 1 if you have the declaration of `isnanf', and to 0 if you don't.
-   */
-#mesondefine HAVE_DECL_ISNANF
-
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #mesondefine HAVE_DLFCN_H
 
@@ -84,9 +72,6 @@
 /* Define to 1 if you have a working `mmap' system call. */
 #mesondefine HAVE_MMAP
 
-/* Define to 1 if you have the `nearbyint' function. */
-#mesondefine HAVE_NEARBYINT
-
 /* Define to 1 if you have the `posix_fallocate' function. */
 #mesondefine HAVE_POSIX_FALLOCATE
 
@@ -96,21 +81,9 @@
 /* Have the Xrandr 1.5 extension library */
 #mesondefine HAVE_RANDR15
 
-/* Define to 1 if you have the `rint' function. */
-#mesondefine HAVE_RINT
-
-/* Define to 1 if you have the `round' function. */
-#mesondefine HAVE_ROUND
-
 /* Define to 1 if you have the `sincos' function. */
 #mesondefine HAVE_SINCOS
 
-/* Define to 1 if you have the `log2` function */
-#mesondefine HAVE_LOG2
-
-/* Define to 1 if you ahve the `exp2` function */
-#mesondefine HAVE_EXP2
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #mesondefine HAVE_STDINT_H
 
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);
 
diff --git a/gtk/gtkcssshorthandpropertyimpl.c b/gtk/gtkcssshorthandpropertyimpl.c
index 82b5893151..4a9b97fd07 100644
--- a/gtk/gtkcssshorthandpropertyimpl.c
+++ b/gtk/gtkcssshorthandpropertyimpl.c
@@ -40,11 +40,6 @@
 #include "gtkcssvalueprivate.h"
 #include "gtktypebuiltins.h"
 
-/* this is in case round() is not provided by the compiler, 
- * such as in the case of C89 compilers, like MSVC
- */
-#include "fallback-c89.c"
-
 /*** PARSING ***/
 
 static gboolean
diff --git a/gtk/gtkcssstyleproperty.c b/gtk/gtkcssstyleproperty.c
index 0fe1bab134..eebf39ad48 100644
--- a/gtk/gtkcssstyleproperty.c
+++ b/gtk/gtkcssstyleproperty.c
@@ -30,11 +30,6 @@
 #include "gtkprivatetypebuiltins.h"
 #include "gtkprivate.h"
 
-/* this is in case round() is not provided by the compiler, 
- * such as in the case of C89 compilers, like MSVC
- */
-#include "fallback-c89.c"
-
 enum {
   PROP_0,
   PROP_ANIMATED,
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index 94cd77f6a1..eabafee6df 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -29,11 +29,6 @@
 #include "gtkintl.h"
 #include "gtkprivatetypebuiltins.h"
 
-/* this is in case round() is not provided by the compiler, 
- * such as in the case of C89 compilers, like MSVC
- */
-#include "fallback-c89.c"
-
 /* the actual parsers we have */
 #include "gtkcssarrayvalueprivate.h"
 #include "gtkcssbgsizevalueprivate.h"
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 7a30849846..3bb4178da6 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -75,8 +75,6 @@
 #include <cairo-gobject.h>
 #include <string.h>
 
-#include "fallback-c89.c"
-
 /**
  * SECTION:gtkentry
  * @Short_description: A single line text entry field
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index c29d2b7a8a..1b40a1e438 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -55,11 +55,6 @@
 #include "gdk/gdktextureprivate.h"
 #include "gdk/gdkprofilerprivate.h"
 
-/* this is in case round() is not provided by the compiler,
- * such as in the case of C89 compilers, like MSVC
- */
-#include "fallback-c89.c"
-
 /**
  * SECTION:gtkicontheme
  * @Short_description: Looking up icons by name
diff --git a/gtk/gtkkineticscrolling.c b/gtk/gtkkineticscrolling.c
index 7acd096680..2e7a12ce55 100644
--- a/gtk/gtkkineticscrolling.c
+++ b/gtk/gtkkineticscrolling.c
@@ -20,8 +20,6 @@
 
 #include <stdio.h>
 
-#include "fallback-c89.c"
-
 /*
  * All our curves are second degree linear differential equations, and
  * so they can always be written as linear combinations of 2 base
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 688c4b3460..3a8e675c85 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -63,11 +63,6 @@
 #include <math.h>
 #include <string.h>
 
-/* this is in case rint() is not provided by the compiler, 
- * such as in the case of C89 compilers, like MSVC
- */
-#include "fallback-c89.c"
-
 /**
  * SECTION:gtklabel
  * @Short_description: A widget that displays a small to medium amount of text
diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c
index d00a03f1f3..caafb489f4 100644
--- a/gtk/gtklevelbar.c
+++ b/gtk/gtklevelbar.c
@@ -140,8 +140,6 @@
 
 #include "a11y/gtklevelbaraccessible.h"
 
-#include "fallback-c89.c"
-
 enum {
   PROP_VALUE = 1,
   PROP_MIN_VALUE,
diff --git a/gtk/gtknumericsorter.c b/gtk/gtknumericsorter.c
index 253fd201d7..eac561241b 100644
--- a/gtk/gtknumericsorter.c
+++ b/gtk/gtknumericsorter.c
@@ -25,7 +25,6 @@
 #include "gtktypebuiltins.h"
 
 #include <math.h>
-#include "fallback-c89.c"
 
 /**
  * SECTION:gtknumericsorter
@@ -127,11 +126,11 @@ gtk_numeric_sorter_compare (GtkSorter *sorter,
         float num1 = g_value_get_float (&value1);
         float num2 = g_value_get_float (&value2);
 
-        if (isnanf (num1) && isnanf (num2))
+        if (isnan (num1) && isnan (num2))
           result = GTK_ORDERING_EQUAL;
-        else if (isnanf (num1))
+        else if (isnan (num1))
           result = self->sort_order == GTK_SORT_ASCENDING ? GTK_ORDERING_LARGER : GTK_ORDERING_SMALLER;
-        else if (isnanf (num2))
+        else if (isnan (num2))
           result = self->sort_order == GTK_SORT_ASCENDING ? GTK_ORDERING_SMALLER : GTK_ORDERING_LARGER;
         else if (num1 < num2)
           result = self->sort_order == GTK_SORT_ASCENDING ? GTK_ORDERING_SMALLER : GTK_ORDERING_LARGER;
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index 83f2aeaf89..58164c4e7e 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -43,8 +43,6 @@
 
 #include <string.h>
 
-#include "fallback-c89.c"
-
 /**
  * SECTION:gtkprogressbar
  * @Short_description: A widget which indicates progress visually
diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c
index c11e377aaf..6ddfa4998a 100644
--- a/gtk/gtkrender.c
+++ b/gtk/gtkrender.c
@@ -34,8 +34,6 @@
 #include "gsk/gskroundedrectprivate.h"
 #include <gdk/gdktextureprivate.h>
 
-#include "fallback-c89.c"
-
 static void
 gtk_do_render_icon (GtkStyleContext        *context,
                     cairo_t                *cr,
diff --git a/gtk/gtkrenderbackground.c b/gtk/gtkrenderbackground.c
index e366188852..fb17730900 100644
--- a/gtk/gtkrenderbackground.c
+++ b/gtk/gtkrenderbackground.c
@@ -43,11 +43,6 @@
 
 #include "gsk/gskroundedrectprivate.h"
 
-/* this is in case round() is not provided by the compiler, 
- * such as in the case of C89 compilers, like MSVC
- */
-#include "fallback-c89.c"
-
 static void
 gtk_theming_background_snapshot_color (GtkCssBoxes       *boxes,
                                        GtkSnapshot       *snapshot,
diff --git a/gtk/gtkrenderborder.c b/gtk/gtkrenderborder.c
index e56d48e16c..1846ace0f9 100644
--- a/gtk/gtkrenderborder.c
+++ b/gtk/gtkrenderborder.c
@@ -39,11 +39,6 @@
 
 #include "gsk/gskroundedrectprivate.h"
 
-/* this is in case round() is not provided by the compiler, 
- * such as in the case of C89 compilers, like MSVC
- */
-#include "fallback-c89.c"
-
 typedef struct _GtkBorderImage GtkBorderImage;
 
 struct _GtkBorderImage {
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c
index 74fdf52f90..158152480c 100644
--- a/gtk/gtkrevealer.c
+++ b/gtk/gtkrevealer.c
@@ -32,8 +32,6 @@
 #include "gtkwidgetprivate.h"
 #include "gtkbuildable.h"
 
-#include "fallback-c89.c"
-
 /**
  * SECTION:gtkrevealer
  * @Short_description: Hide and show with animation
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index 79f0b5c652..99ac45f941 100644
--- a/gtk/gtkswitch.c
+++ b/gtk/gtkswitch.c
@@ -71,8 +71,6 @@
 
 #include "a11y/gtkswitchaccessible.h"
 
-#include "fallback-c89.c"
-
 typedef struct _GtkSwitchClass   GtkSwitchClass;
 
 /**
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 5e6ee4be75..77c469636f 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -73,8 +73,6 @@
 #include <cairo-gobject.h>
 #include <string.h>
 
-#include "fallback-c89.c"
-
 /**
  * SECTION:gtktext
  * @Short_description: A simple single-line text entry field
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 96f4656d4c..18a6b048fa 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -90,9 +90,6 @@
 #include <stdarg.h>
 #include <string.h>
 
-/* for the use of round() */
-#include "fallback-c89.c"
-
 /**
  * SECTION:gtkwidget
  * @Short_description: Base class for all widgets
diff --git a/gtk/inspector/visual.c b/gtk/inspector/visual.c
index 4840f72926..7f1b40d635 100644
--- a/gtk/inspector/visual.c
+++ b/gtk/inspector/visual.c
@@ -45,8 +45,6 @@
 #include "gtkeditable.h"
 #include "gtkentry.h"
 
-#include "fallback-c89.c"
-
 #ifdef GDK_WINDOWING_X11
 #include "x11/gdkx.h"
 #endif
diff --git a/gtk/meson.build b/gtk/meson.build
index 448de76888..c8ebb97168 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -14,7 +14,6 @@ gtk_cargs = [
 # List of sources that do not contain public API, and should not be
 # introspected
 gtk_private_sources = files([
-  'fallback-c89.c',
   'fnmatch.c',
   'tools/gdkpixbufutils.c',
   'gsettings-mapping.c',
diff --git a/meson.build b/meson.build
index 874fee25a8..9295163603 100644
--- a/meson.build
+++ b/meson.build
@@ -191,16 +191,11 @@ check_functions = [
   'getresuid',
   'lstat',
   'mmap',
-  'nearbyint',
   'posix_fallocate',
   '_lock_file',
   'flockfile',
   'mkstemp',
   'mallinfo',
-  'round',
-  'rint',
-  'log2',
-  'exp2',
   'sincos',
   'sincosf',
 ]
@@ -211,10 +206,6 @@ foreach func : check_functions
   endif
 endforeach
 
-cdata.set('HAVE_DECL_ISINF', cc.has_header_symbol('math.h', 'isinf'))
-cdata.set('HAVE_DECL_ISNAN', cc.has_header_symbol('math.h', 'isnan'))
-cdata.set('HAVE_DECL_ISNANF', cc.has_header_symbol('math.h', 'isnanf'))
-
 # Disable deprecation checks for all libraries we depend on on stable branches.
 # This is so newer versions of those libraries don't cause more warnings with
 # a stable GTK version.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]