c40cbb57cf1e5bf805c2ea4e8a25d7946cee1b6a
[feed/packages.git] / libs / libcgroup / patches / 010-cdefs.patch
1 --- a/include/libcgroup/config.h
2 +++ b/include/libcgroup/config.h
3 @@ -5,12 +5,10 @@
4 #error "Only <libcgroup.h> should be included directly."
5 #endif
6
7 -#ifndef SWIG
8 -#include <features.h>
9 +#ifdef __cplusplus
10 +extern "C" {
11 #endif
12
13 -__BEGIN_DECLS
14 -
15 /**
16 * @defgroup group_config 5. Configuration
17 * @{
18 @@ -107,6 +105,8 @@ int cgroup_config_create_template_group(
19 * @}
20 * @}
21 */
22 -__END_DECLS
23 +#ifdef __cplusplus
24 +}
25 +#endif
26
27 #endif /*_LIBCGROUP_CONFIG_H*/
28 --- a/include/libcgroup/error.h
29 +++ b/include/libcgroup/error.h
30 @@ -5,12 +5,10 @@
31 #error "Only <libcgroup.h> should be included directly."
32 #endif
33
34 -#ifndef SWIG
35 -#include <features.h>
36 +#ifdef __cplusplus
37 +extern "C" {
38 #endif
39
40 -__BEGIN_DECLS
41 -
42 /**
43 * @defgroup group_errors 6. Error handling
44 * @{
45 @@ -99,6 +97,8 @@ int cgroup_get_last_errno(void);
46 * @}
47 * @}
48 */
49 -__END_DECLS
50 +#ifdef __cplusplus
51 +}
52 +#endif
53
54 #endif /* _LIBCGROUP_INIT_H */
55 --- a/include/libcgroup/groups.h
56 +++ b/include/libcgroup/groups.h
57 @@ -6,12 +6,13 @@
58 #endif
59
60 #ifndef SWIG
61 -#include <features.h>
62 #include <sys/types.h>
63 #include <stdbool.h>
64 #endif
65
66 -__BEGIN_DECLS
67 +#ifdef __cplusplus
68 +extern "C" {
69 +#endif
70
71 /**
72 * Flags for cgroup_delete_cgroup_ext().
73 @@ -577,6 +578,8 @@ char *cgroup_get_cgroup_name(struct cgroup *cgroup);
74 */
75
76
77 -__END_DECLS
78 +#ifdef __cplusplus
79 +}
80 +#endif
81
82 #endif /* _LIBCGROUP_GROUPS_H */
83 --- a/include/libcgroup/init.h
84 +++ b/include/libcgroup/init.h
85 @@ -5,12 +5,10 @@
86 #error "Only <libcgroup.h> should be included directly."
87 #endif
88
89 -#ifndef SWIG
90 -#include <features.h>
91 +#ifdef __cplusplus
92 +extern "C" {
93 #endif
94
95 -__BEGIN_DECLS
96 -
97 /**
98 * @defgroup group_init 1. Initialization
99 * @{
100 @@ -58,6 +56,8 @@ int cgroup_get_subsys_mount_point(const char *controller, char **mount_point);
101 * @}
102 * @}
103 */
104 -__END_DECLS
105 +#ifdef __cplusplus
106 +}
107 +#endif
108
109 #endif /* _LIBCGROUP_INIT_H */
110 --- a/include/libcgroup/iterators.h
111 +++ b/include/libcgroup/iterators.h
112 @@ -8,10 +8,11 @@
113 #ifndef SWIG
114 #include <sys/types.h>
115 #include <stdio.h>
116 -#include <features.h>
117 #endif
118
119 -__BEGIN_DECLS
120 +#ifdef __cplusplus
121 +extern "C" {
122 +#endif
123
124 /**
125 * @defgroup group_iterators 3. Iterators
126 @@ -423,6 +424,8 @@ int cgroup_get_subsys_mount_point_end(void **handle);
127 * @}
128 */
129
130 -__END_DECLS
131 +#ifdef __cplusplus
132 +}
133 +#endif
134
135 #endif /* _LIBCGROUP_ITERATORS_H */
136 --- a/include/libcgroup/log.h
137 +++ b/include/libcgroup/log.h
138 @@ -5,13 +5,11 @@
139 #error "Only <libcgroup.h> should be included directly."
140 #endif
141
142 -#ifndef SWIG
143 -#include <features.h>
144 -#endif
145 -
146 #include <stdarg.h>
147
148 -__BEGIN_DECLS
149 +#ifdef __cplusplus
150 +extern "C" {
151 +#endif
152
153 /**
154 * @defgroup group_log 7. Logging
155 @@ -142,6 +140,8 @@ extern int cgroup_parse_log_level_str(const char *levelstr);
156 * @}
157 * @}
158 */
159 -__END_DECLS
160 +#ifdef __cplusplus
161 +}
162 +#endif
163
164 #endif /* _LIBCGROUP_LOG_H */
165 --- a/include/libcgroup/tasks.h
166 +++ b/include/libcgroup/tasks.h
167 @@ -8,11 +8,12 @@
168 #include <libcgroup/groups.h>
169
170 #ifndef SWIG
171 -#include <features.h>
172 #include <stdbool.h>
173 #endif
174
175 -__BEGIN_DECLS
176 +#ifdef __cplusplus
177 +extern "C" {
178 +#endif
179
180 /** Flags for cgroup_change_cgroup_uid_gid(). */
181 enum cgflags {
182 @@ -204,6 +205,8 @@ int cgroup_register_unchanged_process(pid_t pid, int flags);
183 * @}
184 * @}
185 */
186 -__END_DECLS
187 +#ifdef __cplusplus
188 +}
189 +#endif
190
191 #endif /* _LIBCGROUP_TASKS_H */
192 --- a/src/daemon/cgrulesengd.h
193 +++ b/src/daemon/cgrulesengd.h
194 @@ -15,9 +15,9 @@
195 #ifndef _CGRULESENGD_H
196 #define _CGRULESENGD_H
197
198 -#include <features.h>
199 -
200 -__BEGIN_DECLS
201 +#ifdef __cplusplus
202 +extern "C" {
203 +#endif
204
205 #include "config.h"
206 #include "libcgroup.h"
207 @@ -119,7 +119,9 @@ void cgre_flash_templates(int signum);
208 */
209 void cgre_catch_term(int signum);
210
211 -__END_DECLS
212 +#ifdef __cplusplus
213 +}
214 +#endif
215
216 #endif /* _CGRULESENGD_H */
217
218 --- a/src/libcgroup-internal.h
219 +++ b/src/libcgroup-internal.h
220 @@ -16,7 +16,9 @@
221
222 #define __LIBCG_INTERNAL
223
224 -__BEGIN_DECLS
225 +#ifdef __cplusplus
226 +extern "C" {
227 +#endif
228
229 #include "config.h"
230 #include <fts.h>
231 @@ -279,6 +281,8 @@ extern void cgroup_dictionary_iterator_end(void **handle);
232 */
233 int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask);
234
235 -__END_DECLS
236 +#ifdef __cplusplus
237 +}
238 +#endif
239
240 #endif