From 09ac85ba0a7b0fdfa52f460e24d86795fbb12032 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 25 Mar 2008 23:45:07 +0000 Subject: basic c++ compat git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@42 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce --- src/macro.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/macro.h') 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 -- cgit