This is first step towards stopping to assume that HAVE_BSD_REGS_T implies
FreeBSD-style code. This breaks on NetBSD in several places.
Perhaps HAVE_BSD_REGS_T should be renamed to HAVE_FREEBSD_REGS_T.
Check headers with this fashion:
- FreeBSD requires <sys/types.h> for <machine/npx.h>
- FreeBSD requires <sys/cdefs.h> for <machine/reg.h>
- NetBSD doesn't need extra includes for <machine/reg.h>
- NetBSD requires <sys/param.h> before inclusion of <sys/cdefs.h>
#cmakedefine01 HAVE_SYS_VMPARAM_H
#cmakedefine01 HAVE_MACH_VM_TYPES_H
#cmakedefine01 HAVE_MACH_VM_PARAM_H
+#cmakedefine01 HAVE_MACHINE_NPX_H
+#cmakedefine01 HAVE_MACHINE_REG_H
#cmakedefine01 HAVE_MACHINE_VMPARAM_H
#cmakedefine01 HAVE_PROCFS_H
#cmakedefine01 HAVE_CRT_EXTERNS_H
check_include_files(sys/vmparam.h HAVE_SYS_VMPARAM_H)
check_include_files(mach/vm_types.h HAVE_MACH_VM_TYPES_H)
check_include_files(mach/vm_param.h HAVE_MACH_VM_PARAM_H)
+check_include_files("sys/param.h;sys/types.h;machine/npx.h" HAVE_MACHINE_NPX_H)
+check_include_files("sys/param.h;sys/cdefs.h;machine/reg.h" HAVE_MACHINE_REG_H)
check_include_files(machine/vmparam.h HAVE_MACHINE_VMPARAM_H)
check_include_files(procfs.h HAVE_PROCFS_H)
check_include_files(crt_externs.h HAVE_CRT_EXTERNS_H)
#if !HAVE_MACH_EXCEPTIONS
-#if HAVE_BSD_REGS_T
+#if HAVE_MACHINE_REG_H
#include <machine/reg.h>
+#endif // HAVE_MACHINE_REG_H
+#if HAVE_MACHINE_NPX_H
#include <machine/npx.h>
-#endif // HAVE_BSD_REGS_T
+#endif // HAVE_MACHINE_NPX_H
+
#if HAVE_PT_REGS
#include <asm/ptrace.h>
#endif // HAVE_PT_REGS