diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-11-07 16:44:48 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-11-07 16:53:26 +0100 |
commit | 0095c45415ad24338342369d76d5635088294eae (patch) | |
tree | bec2c51b45b950b17e2427031a0de7a2c150668b /src/systemd/_sd-common.h | |
parent | 1ec6af16f501a6e281fe5604d4be8380bad38646 (diff) |
api: replace manual C++ guards by macros
Diffstat (limited to 'src/systemd/_sd-common.h')
-rw-r--r-- | src/systemd/_sd-common.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/systemd/_sd-common.h b/src/systemd/_sd-common.h index b861e3354..b0c48aab9 100644 --- a/src/systemd/_sd-common.h +++ b/src/systemd/_sd-common.h @@ -40,9 +40,31 @@ # define _sd_packed_ __attribute__((packed)) #endif -#ifndef _sd_stringify -# define _sd_xstringify(x) #x -# define _sd_stringify(x) _sd_xstringify(x) +#ifndef _SD_STRINGIFY +# define _SD_XSTRINGIFY(x) #x +# define _SD_STRINGIFY(x) _SD_XSTRINGIFY(x) +#endif + +#ifndef _SD_BEGIN_DECLARATIONS +# ifdef __cplusplus +# define _SD_BEGIN_DECLARATIONS \ + extern "C" { \ + struct __useless_struct_to_allow_trailing_semicolon__ +# else +# define _SD_BEGIN_DECLARATIONS \ + struct __useless_struct_to_allow_trailing_semicolon__ +# endif +#endif + +#ifndef _SD_END_DECLARATIONS +# ifdef __cplusplus +# define _SD_END_DECLARATIONS \ + } \ + struct __useless_struct_to_allow_trailing_semicolon__ +# else +# define _SD_END_DECLARATIONS \ + struct __useless_struct_to_allow_trailing_semicolon__ +# endif #endif #endif |