summaryrefslogtreecommitdiff
path: root/glnx-backports.h
diff options
context:
space:
mode:
Diffstat (limited to 'glnx-backports.h')
-rw-r--r--glnx-backports.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/glnx-backports.h b/glnx-backports.h
index b535e2d..71c3f5c 100644
--- a/glnx-backports.h
+++ b/glnx-backports.h
@@ -1,6 +1,7 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2015 Colin Walters <walters@verbum.org>
+ * Copyright 2017 Emmanuele Bassi
* SPDX-License-Identifier: LGPL-2.0-or-later
*
* GLIB - Library of useful routines for C programming
@@ -84,4 +85,9 @@ gboolean glnx_set_object (GObject **object_ptr,
#define G_OPTION_ENTRY_NULL { NULL, 0, 0, 0, NULL, NULL, NULL }
#endif
+#ifndef G_APPROX_VALUE /* added in 2.58 */
+#define G_APPROX_VALUE(a, b, epsilon) \
+ (((a) > (b) ? (a) - (b) : (b) - (a)) < (epsilon))
+#endif
+
G_END_DECLS