summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2016-01-31 10:59:53 +0100
committerKamil Rytarowski <n54@gmx.com>2016-01-31 15:03:46 +0100
commitc1e50f965c44c0a093921f741cd1bd7af84bda5d (patch)
treefaa61d4508587827be0f06d30803933ad44a3eed
parent7e1facef368a74a7a0c46e359378beae90af462b (diff)
downloadcoreclr-c1e50f965c44c0a093921f741cd1bd7af84bda5d.tar.gz
coreclr-c1e50f965c44c0a093921f741cd1bd7af84bda5d.tar.bz2
coreclr-c1e50f965c44c0a093921f741cd1bd7af84bda5d.zip
NetBSD doesn't ship with <machine/npx.h>.
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>
-rw-r--r--src/pal/src/config.h.in2
-rw-r--r--src/pal/src/configure.cmake2
-rw-r--r--src/pal/src/thread/context.cpp7
3 files changed, 9 insertions, 2 deletions
diff --git a/src/pal/src/config.h.in b/src/pal/src/config.h.in
index f132b13cab..a21910f128 100644
--- a/src/pal/src/config.h.in
+++ b/src/pal/src/config.h.in
@@ -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
diff --git a/src/pal/src/configure.cmake b/src/pal/src/configure.cmake
index 7817873d5f..ab5a51ddd0 100644
--- a/src/pal/src/configure.cmake
+++ b/src/pal/src/configure.cmake
@@ -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)
diff --git a/src/pal/src/thread/context.cpp b/src/pal/src/thread/context.cpp
index 2165616462..1f48080000 100644
--- a/src/pal/src/thread/context.cpp
+++ b/src/pal/src/thread/context.cpp
@@ -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