diff options
author | Kelvin Zhang <zhangkelvin@google.com> | 2021-12-01 21:53:15 +0800 |
---|---|---|
committer | Gao Xiang <xiang@kernel.org> | 2021-12-02 09:46:13 +0800 |
commit | 519dbd2368240c4c6d159459ab5614e1d9540c3c (patch) | |
tree | 45b5804f92d5ce225347db5435f8690ccbf01924 /include/erofs/hashmap.h | |
parent | c816397a43b050fff84337b4484e67f72cb5501a (diff) | |
download | erofs-utils-519dbd2368240c4c6d159459ab5614e1d9540c3c.tar.gz |
erofs-utils: make liberofs more C++ friendly
1. Add extern "C" wrappers to headers, so that they can be included
from C++
2. Add const keywords to certain pointer type params
Link: https://lore.kernel.org/r/20211201135315.3732-1-xiang@kernel.org
Signed-off-by: Kelvin Zhang <zhangkelvin@google.com>
Signed-off-by: Gao Xiang <xiang@kernel.org>
Diffstat (limited to 'include/erofs/hashmap.h')
-rw-r--r-- | include/erofs/hashmap.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/erofs/hashmap.h b/include/erofs/hashmap.h index 024a14e..3d38578 100644 --- a/include/erofs/hashmap.h +++ b/include/erofs/hashmap.h @@ -2,6 +2,11 @@ #ifndef __EROFS_HASHMAP_H #define __EROFS_HASHMAP_H +#ifdef __cplusplus +extern "C" +{ +#endif + /* Copied from https://github.com/git/git.git */ #include <stdio.h> #include <stdlib.h> @@ -100,4 +105,8 @@ static inline const char *strintern(const char *string) return memintern(string, strlen(string)); } +#ifdef __cplusplus +} +#endif + #endif |