From 391feb7d4d3f1e76af398111be3bc592539d5161 Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Wed, 17 Aug 2016 15:31:53 +0100 Subject: [PATCH] Fixes for NetBSD --- src/ctypes/posix_types_stubs.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ctypes/posix_types_stubs.c b/src/ctypes/posix_types_stubs.c index 0373baf4..eb1e9c79 100644 --- a/src/ctypes/posix_types_stubs.c +++ b/src/ctypes/posix_types_stubs.c @@ -56,6 +56,18 @@ #define EXPOSE_ALIGNMENT(X) EXPOSE_ALIGNMENT_COMMON(X, X) #define EXPOSE_ALIGNMENT_S(X) EXPOSE_ALIGNMENT_COMMON(X, UNDERSCORE(X)) +#ifdef __NetBSD__ +/* NetBSD defines these types as macros, which expands to the wrong thing + * in the EXPOSE_* macros above. I have no idea how to prevent cpp from + * expanding macro arguments, so just hack around it for now. */ +#undef off_t +#undef mode_t +#undef pid_t +typedef __off_t off_t; +typedef __mode_t mode_t; +typedef __pid_t pid_t; +#endif + EXPOSE_TYPEINFO(clock_t) EXPOSE_TYPEINFO_S(dev_t) EXPOSE_TYPEINFO_S(ino_t)