aboutsummaryrefslogtreecommitdiff
path: root/include/erofs/print.h
diff options
context:
space:
mode:
authorKelvin Zhang <zhangkelvin@google.com>2021-12-01 21:53:15 +0800
committerGao Xiang <xiang@kernel.org>2021-12-02 09:46:13 +0800
commit519dbd2368240c4c6d159459ab5614e1d9540c3c (patch)
tree45b5804f92d5ce225347db5435f8690ccbf01924 /include/erofs/print.h
parentc816397a43b050fff84337b4484e67f72cb5501a (diff)
downloaderofs-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/print.h')
-rw-r--r--include/erofs/print.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/erofs/print.h b/include/erofs/print.h
index 91f864b..2213d1d 100644
--- a/include/erofs/print.h
+++ b/include/erofs/print.h
@@ -7,6 +7,11 @@
#ifndef __EROFS_PRINT_H
#define __EROFS_PRINT_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#include "config.h"
#include <stdio.h>
@@ -72,4 +77,8 @@ enum {
#define erofs_dump(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
+#ifdef __cplusplus
+}
+#endif
+
#endif