From 73a890633081be063e1f4799679994edcc68013e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Thu, 17 Sep 2015 19:35:12 +0200
Subject: [PATCH] Cpp: Rename some of the hashtable functions.

This is to avoid clashes with other libraries (in particular
mariadb-connector-c 2.2 which has (and uses) a hash_insert()).

Fixes [bug 7560].
---
 src/hashtable.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/hashtable.h b/src/hashtable.h
index 14f68c9bb9..ff9caa9036 100644
--- a/src/hashtable.h
+++ b/src/hashtable.h
@@ -31,6 +31,15 @@ struct hash_table
   struct hash_entry *htable[1];
 };
 
+/* Remap some of the symbols that might clash with other libraries.
+ *
+ * NB: hash_insert is known to clash with mariadb-connector-c 2.2.
+ */
+#define hash_lookup	pike_hash_lookup
+#define hash_rehash	pike_hash_rehash
+#define hash_insert	pike_hash_insert
+#define hash_unlink	pike_hash_unlink
+
 /* Prototypes begin here */
 struct hash_entry *hash_lookup(const struct hash_table *h,
                                const struct pike_string *s);
-- 
GitLab