summaryrefslogtreecommitdiff
path: root/src/systemd/_sd-common.h
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-04-28 07:18:56 +0200
committerSven Eden <yamakuzure@gmx.net>2017-05-17 15:22:16 +0200
commit51e8372fb6cca277dc7afc6e83f48a1a2b6d4dbe (patch)
tree7cb0fd6ba86f34583435b04a828939a7d086fe27 /src/systemd/_sd-common.h
parent2774f4e488e1b86960c6ff74c2195de6643bfd52 (diff)
Prep v229: Add missing fixes from upstream [6/6] src/systemd
Diffstat (limited to 'src/systemd/_sd-common.h')
-rw-r--r--src/systemd/_sd-common.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/systemd/_sd-common.h b/src/systemd/_sd-common.h
index 896a027eb..2d4e1f26e 100644
--- a/src/systemd/_sd-common.h
+++ b/src/systemd/_sd-common.h
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
#ifndef foosdcommonhfoo
#define foosdcommonhfoo
@@ -57,10 +55,10 @@
# ifdef __cplusplus
# define _SD_BEGIN_DECLARATIONS \
extern "C" { \
- struct __useless_struct_to_allow_trailing_semicolon__
+ struct _sd_useless_struct_to_allow_trailing_semicolon_
# else
# define _SD_BEGIN_DECLARATIONS \
- struct __useless_struct_to_allow_trailing_semicolon__
+ struct _sd_useless_struct_to_allow_trailing_semicolon_
# endif
#endif
@@ -68,11 +66,18 @@
# ifdef __cplusplus
# define _SD_END_DECLARATIONS \
} \
- struct __useless_struct_to_allow_trailing_semicolon__
+ struct _sd_useless_cpp_struct_to_allow_trailing_semicolon_
# else
# define _SD_END_DECLARATIONS \
- struct __useless_struct_to_allow_trailing_semicolon__
+ struct _sd_useless_struct_to_allow_trailing_semicolon_
# endif
#endif
+#define _SD_DEFINE_POINTER_CLEANUP_FUNC(type, func) \
+ static inline void func##p(type **p) { \
+ if (*p) \
+ func(*p); \
+ } \
+ struct _sd_useless_struct_to_allow_trailing_semicolon_
+
#endif