commit e3a6c03: [Minor] Add C++ safe guards

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Sep 29 17:07:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-09-29 17:58:12 +0100
URL: https://github.com/rspamd/rspamd/commit/e3a6c03b42500262a4048dd32def12623cfb2619

[Minor] Add C++ safe guards

---
 contrib/fastutf8/fastutf8.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/contrib/fastutf8/fastutf8.h b/contrib/fastutf8/fastutf8.h
index 001499ab3..a1e9cbf03 100644
--- a/contrib/fastutf8/fastutf8.h
+++ b/contrib/fastutf8/fastutf8.h
@@ -29,6 +29,9 @@
 #include <stdbool.h>
 #include <stdint.h>
 
+#ifdef  __cplusplus
+extern "C" {
+#endif
 enum rspamd_fast_utf8_cpu_flags {
 	RSPAMD_FAST_UTF8_FLAG_SSE41 = 1u << 0u,
 	RSPAMD_FAST_UTF8_FLAG_AVX2 = 1u << 1u,
@@ -38,7 +41,7 @@ enum rspamd_fast_utf8_cpu_flags {
  * Called to init codecs
  * @param flags
  */
-void rspamd_fast_utf8_library_init (unsigned flags);
+void rspamd_fast_utf8_library_init(unsigned flags);
 
 /**
  * Called to validate input using fast codec
@@ -46,7 +49,7 @@ void rspamd_fast_utf8_library_init (unsigned flags);
  * @param len
  * @return
  */
-off_t rspamd_fast_utf8_validate (const unsigned char *data, size_t len);
+off_t rspamd_fast_utf8_validate(const unsigned char *data, size_t len);
 
 /**
  * Use plain C implementation
@@ -54,6 +57,9 @@ off_t rspamd_fast_utf8_validate (const unsigned char *data, size_t len);
  * @param len
  * @return
  */
-off_t rspamd_fast_utf8_validate_ref (const unsigned char *data, size_t len);
+off_t rspamd_fast_utf8_validate_ref(const unsigned char *data, size_t len);
 
+#ifdef  __cplusplus
+}
+#endif
 #endif


More information about the Commits mailing list