]>
git.proxmox.com Git - systemd.git/blob - src/systemd/_sd-common.h
1 #ifndef foosdcommonhfoo
2 #define foosdcommonhfoo
5 This file is part of systemd.
7 Copyright 2013 Lennart Poettering
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 /* This is a private header; never even think of including this directly! */
25 #if __INCLUDE_LEVEL__ <= 1
26 #error "Do not include _sd-common.h directly; it is a private header."
31 # define _sd_printf_(a,b) __attribute__ ((format (printf, a, b)))
33 # define _sd_printf_(a,b)
38 # define _sd_sentinel_ __attribute__((sentinel))
42 # define _sd_packed_ __attribute__((packed))
46 # define _sd_pure_ __attribute__((pure))
50 # define _SD_XSTRINGIFY(x) #x
51 # define _SD_STRINGIFY(x) _SD_XSTRINGIFY(x)
54 #ifndef _SD_BEGIN_DECLARATIONS
56 # define _SD_BEGIN_DECLARATIONS \
58 struct _sd_useless_struct_to_allow_trailing_semicolon_
60 # define _SD_BEGIN_DECLARATIONS \
61 struct _sd_useless_struct_to_allow_trailing_semicolon_
65 #ifndef _SD_END_DECLARATIONS
67 # define _SD_END_DECLARATIONS \
69 struct _sd_useless_cpp_struct_to_allow_trailing_semicolon_
71 # define _SD_END_DECLARATIONS \
72 struct _sd_useless_struct_to_allow_trailing_semicolon_
76 #define _SD_DEFINE_POINTER_CLEANUP_FUNC(type, func) \
77 static inline void func##p(type **p) { \
81 struct _sd_useless_struct_to_allow_trailing_semicolon_