>From a7f1d5df3cac5bbf7df018d11de5d1676592f37b Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 11 Oct 2020 23:37:17 +0200 Subject: [PATCH 2/3] hash, xhash: Make usable from C++. * lib/hash.h: Add extern "C". --- ChangeLog | 5 +++++ lib/hash.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 83518c7..299074f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2020-10-11 Bruno Haible + hash, xhash: Make usable from C++. + * lib/hash.h: Add extern "C". + +2020-10-11 Bruno Haible + hash, xhash: Move comments to the .h file. * lib/hash.c: Move comments meant for the user from here... * lib/xhash.c: ... and here... diff --git a/lib/hash.h b/lib/hash.h index 848117d..a9d78c0 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -27,6 +27,10 @@ # include # include +# ifdef __cplusplus +extern "C" { +# endif + struct hash_tuning { /* This structure is mainly used for 'hash_initialize', see the block @@ -245,4 +249,8 @@ extern int hash_insert_if_absent (Hash_table *table, const void *entry, table, don't modify the table and return NULL. */ extern void *hash_delete (Hash_table *table, const void *entry); +# ifdef __cplusplus +} +# endif + #endif -- 2.7.4