From f0e75527194fc0821af1cb4d01cbb12928a77926 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 17 Oct 2020 03:00:35 +0200 Subject: [PATCH] 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 2fd62f2942..d8643b94cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-10-16 Bruno Haible + + hash, xhash: Make usable from C++. + * lib/hash.h: Add extern "C". + 2020-10-16 Bruno Haible hash, xhash: Move comments to the .h file. diff --git a/lib/hash.h b/lib/hash.h index 848117db9f..a9d78c0fa2 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.39.5