> is there a way to setup an Arch Linux based build environment on Travis?
Probably not Travis, but it's very easy to set up a Arch VM. I recommend using the base box https://github.com/terrywang/vagrantboxes/blob/master/archlinux-x86_64.md with Vagrant which is how I get Arch.
What you really need here, though, is an up-to-date glibc.
> Is there any generic way to fix this other than #ifndef __APPLE__?
Autoconf, `AC_HEADER_MAJOR`.
I don't think `__APPLE__` is appropriate here, it's clearly a BSD vs (very recent) GNU problem. And you can resolve it by removing the `-Werror` flag, since it's just a deprecation warning.
> What happens if you do not include any of types.h or sysmacros.h
That doesn't work on macOS. And other BSD variants, I would imagine.