diff --git a/gtk/gtkborderimage.c b/gtk/gtkborderimage.c index 4f6ded6aa1..d5510ab5d7 100644 --- a/gtk/gtkborderimage.c +++ b/gtk/gtkborderimage.c @@ -28,6 +28,11 @@ #include "gtkborderimageprivate.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" + G_DEFINE_BOXED_TYPE (GtkBorderImage, _gtk_border_image, _gtk_border_image_ref, _gtk_border_image_unref) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 6a6f72cf0a..9fadbfd2d2 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -54,6 +54,11 @@ #include "a11y/gtklabelaccessible.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 @@ -230,26 +235,6 @@ * */ - -/*rint() is only available in GCC and/or C99*/ -#if (__STDC_VERSION__ < 199901L && !defined __GNUC__) -double rint(double x) -{ - if (ceil(x+0.5) == floor(x+0.5)) - { - int a = (int)ceil(x); - if (a%2 == 0) - return ceil(x); - else - return floor(x); - } - else - return floor(x+0.5); -} -#endif - - - struct _GtkLabelPrivate { GtkLabelSelectionInfo *select_info; diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c index 73200dc3e4..69f2e8ec4a 100644 --- a/gtk/gtkstyleproperty.c +++ b/gtk/gtkstyleproperty.c @@ -42,6 +42,11 @@ #include "gtkthemingengine.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" + static GHashTable *parse_funcs = NULL; static GHashTable *print_funcs = NULL; static GHashTable *properties = NULL;