fixed build on OpenBSD and possibly Mac OS X