:: commit 0070851478fe6fbb5a431aa0bb1e2171518b91e4

dearblue <dearblue@users.osdn.me> — 2023-10-15 08:36

parents: bb2ced7b1f

Declare with C linkage for C++ (#117)

diff --git a/include/libbz3.h b/include/libbz3.h
index 5e9f723..6a5b5fc 100644
--- a/include/libbz3.h
+++ b/include/libbz3.h
@@ -40,6 +40,10 @@
     #define BZIP3_API BZIP3_VISIBLE
 #endif
 
+#ifdef __cplusplus
+extern "c" {
+#endif
+
 #define BZ3_OK 0
 #define BZ3_ERR_OUT_OF_BOUNDS -1
 #define BZ3_ERR_BWT -2
@@ -141,4 +145,8 @@ BZIP3_API void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[
 BZIP3_API void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[],
                                  int32_t orig_sizes[], int32_t n);
 
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
 #endif
tab: 248 wrap: offon