You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
3.9 KiB

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