The macros __BEGIN_DECLS and __END_DECLS are a GNU-ism found in
glibc and uClibc, but not musl. We replace them by the more general
extern "C" { ... } block exposed only if we have __cplusplus.
Forward ported from a patch by Anthony G. Basile <blueness@gentoo.org>.
Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit
215974e67a24edf9097507e8707190b6a42c7207)
#include <features.h>
#endif
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* @defgroup group_config 5. Configuration
* @}
* @}
*/
-__END_DECLS
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#endif /*_LIBCGROUP_CONFIG_H*/
#include <features.h>
#endif
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* @defgroup group_errors 6. Error handling
* @}
* @}
*/
-__END_DECLS
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#endif /* _LIBCGROUP_INIT_H */
#include <stdbool.h>
#endif
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* Flags for cgroup_delete_cgroup_ext().
*/
-__END_DECLS
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#endif /* _LIBCGROUP_GROUPS_H */
#include <features.h>
#endif
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* @defgroup group_init 1. Initialization
* @}
* @}
*/
-__END_DECLS
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#endif /* _LIBCGROUP_INIT_H */
#include <features.h>
#endif
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* @defgroup group_iterators 3. Iterators
* @}
*/
-__END_DECLS
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#endif /* _LIBCGROUP_ITERATORS_H */
#include <stdarg.h>
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* @defgroup group_log 7. Logging
* @}
* @}
*/
-__END_DECLS
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#endif /* _LIBCGROUP_LOG_H */
#include <stdbool.h>
#endif
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
/** Flags for cgroup_change_cgroup_uid_gid(). */
enum cgflags {
* @}
* @}
*/
-__END_DECLS
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#endif /* _LIBCGROUP_TASKS_H */
#include "libcgroup.h"
%}
-#ifdef __cplusplus
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS }
-#else
-#define __BEGIN_DECLS
-#define __END_DECLS
-#endif
-
%include typemaps.i
%include cpointer.i
%pointer_functions(int, intp);
#include <features.h>
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "config.h"
#include "libcgroup.h"
*/
void cgre_catch_term(int signum);
-__END_DECLS
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#endif /* _CGRULESENGD_H */
#define __LIBCG_INTERNAL
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "config.h"
#include <dirent.h>
#endif /* UNIT_TEST */
-__END_DECLS
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#endif
#define __TOOLS_COMMON
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "config.h"
#include <libcgroup.h>
#include "../libcgroup-internal.h"
#endif /* UNIT_TEST */
-__END_DECLS
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#endif /* TOOLS_COMMON */