updated: [master] [335c5a7] glibcompat: remove g_direct_equal shim

1 view
Skip to first unread message

Yury V. Zaytsev

unread,
Jun 3, 2024, 10:19:12 AMJun 3
to mc-co...@googlegroups.com
The following commit has been merged in the master branch:
commit 335c5a78bbf2e4a5c2346b9fe97c55bceb8d25bc
Author: Yury V. Zaytsev <yu...@shurup.com>
Date: Sun Jun 2 22:16:28 2024 +0200

glibcompat: remove g_direct_equal shim

This function is present at least in glib-2.43.92:

../../lib/glibcompat.c:69:1: error: static declaration of 'g_direct_equal' follows non-static declaration
69 | g_direct_equal (gconstpointer v1, gconstpointer v2)
| ^~~~~~~~~~~~~~
In file included from /home/zaytsev/opt/glib/include/glib-2.0/glib.h:50,
from ../../lib/global.h:10,
from ../../lib/glibcompat.c:36:
/home/zaytsev/opt/glib/include/glib-2.0/glib/ghash.h:180:10: note: previous declaration of 'g_direct_equal' was here
180 | gboolean g_direct_equal (gconstpointer v1,
| ^~~~~~~~~~~~~~

Signed-off-by: Yury V. Zaytsev <yu...@shurup.com>

diff --git a/lib/glibcompat.c b/lib/glibcompat.c
index a5387d4..bb5f104 100644
--- a/lib/glibcompat.c
+++ b/lib/glibcompat.c
@@ -48,30 +48,6 @@
/*** file scope functions ************************************************************************/
/* --------------------------------------------------------------------------------------------- */

-#if ! GLIB_CHECK_VERSION (2, 54, 0)
-/**
- * g_direct_equal:
- * @v1: (nullable): a key
- * @v2: (nullable): a key to compare with @v1
- *
- * Compares two #gpointer arguments and returns %TRUE if they are equal.
- * It can be passed to g_hash_table_new() as the @key_equal_func
- * parameter, when using opaque pointers compared by pointer value as
- * keys in a #GHashTable.
- *
- * This equality function is also appropriate for keys that are integers
- * stored in pointers, such as `GINT_TO_POINTER (n)`.
- *
- * Returns: %TRUE if the two keys match.
- */
-
-static gboolean
-g_direct_equal (gconstpointer v1, gconstpointer v2)
-{
- return v1 == v2;
-}
-#endif /* ! GLIB_CHECK_VERSION (2, 54, 0) */
-
/* --------------------------------------------------------------------------------------------- */
/*** public functions ****************************************************************************/
/* --------------------------------------------------------------------------------------------- */

--
Midnight Commander Development
Reply all
Reply to author
Forward
0 new messages