summaryrefslogtreecommitdiffstats
path: root/src/macro.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/macro.h')
-rw-r--r--src/macro.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/macro.h b/src/macro.h
index 4f2d018..30a7be4 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -105,4 +105,14 @@ typedef void (*sa_free_cb_t)(void *);
typedef int sa_bool_t;
+/* Guard C code in headers, while including them from C++ */
+#ifdef __cplusplus
+# define SA_BEGIN_DECLS extern "C" {
+# define SA_END_DECLS }
+#else
+# define SA_BEGIN_DECLS
+# define SA_END_DECLS
+#endif
+
+
#endif