Skip to content

Commit

Permalink
Merge pull request #433 from yallop/netbsd-support
Browse files Browse the repository at this point in the history
Fixes for NetBSD
  • Loading branch information
yallop authored Aug 22, 2016
2 parents 1110b12 + 391feb7 commit 414cb8a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ctypes/posix_types_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 414cb8a

Please sign in to comment.