From b77b2265f0a45ebc9ca4734f90f9e12ad2139ba2 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 28 Sep 2017 10:40:17 -0700 Subject: [PATCH] Avoid including sys/cdefs.h header sys/cdefs.h is non-standard, and other headers in the project already just use `#ifdef __cplusplus` directly. The existing ifdefs and defines are confusing and broken in some cases (for instance, musl libc does not provide sys/cdefs.h, so the build fails). --- src/vpool.h | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/vpool.h b/src/vpool.h index 04707cb..71b9710 100644 --- a/src/vpool.h +++ b/src/vpool.h @@ -21,18 +21,6 @@ #define _VPOOL_H_ #include -#if !defined(_WINDOWS) && !defined(__sun__) -#include -#else -#ifdef __cplusplus -#define __BEGIN_DECLS extern "C" { -#define __END_DECLS } -#else -#define __BEGIN_DECLS -#define __END_DECLS -#endif /* __cplusplus */ -#endif /* _WINDOWS */ - #include struct vpool { @@ -49,7 +37,9 @@ struct vpool { enum vpool_trunc {VPOOL_EXCLUDE, VPOOL_INCLUDE}; #define VPOOL_TAIL UINT_MAX -__BEGIN_DECLS +#ifdef __cplusplus +extern "C" { +#endif void vpool_init(struct vpool *pool, size_t blksize, size_t limit); void vpool_final(struct vpool *pool); @@ -71,6 +61,8 @@ int vpool_truncate(struct vpool *pool, void vpool_export(struct vpool *pool, void **buf, size_t *size); -__END_DECLS +#ifdef __cplusplus +} +#endif #endif /* !_VPOOL_H_ */ -- 2.14.2