NetBSD doesn't ship with <machine/npx.h>.
authorKamil Rytarowski <n54@gmx.com>
Sun, 31 Jan 2016 09:59:53 +0000 (10:59 +0100)
committerKamil Rytarowski <n54@gmx.com>
Sun, 31 Jan 2016 14:03:46 +0000 (15:03 +0100)
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>

src/pal/src/config.h.in
src/pal/src/configure.cmake
src/pal/src/thread/context.cpp

index f132b13cab92c1b8ee6a402406b77d07c0417b41..a21910f1281c5c0a60898e924da2bd9da3050bb3 100644 (file)
@@ -6,6 +6,8 @@
 #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
index 7817873d5f92b6f625e7b620bb48ed34eaf48045..ab5a51ddd0d726164423bfd585deaf8bfa2a1c62 100644 (file)
@@ -23,6 +23,8 @@ check_include_files(alloca.h HAVE_ALLOCA_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)
index 2165616462de436d49a1281c192b8b01a3a58b4e..1f48080000317239c4d3e4d8489c2625e7c4d3da 100644 (file)
@@ -50,10 +50,13 @@ extern void CONTEXT_CaptureContext(LPCONTEXT lpContext);
 
 #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