From c1e50f965c44c0a093921f741cd1bd7af84bda5d Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Sun, 31 Jan 2016 10:59:53 +0100 Subject: [PATCH] NetBSD doesn't ship with . 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 for - FreeBSD requires for - NetBSD doesn't need extra includes for - NetBSD requires before inclusion of --- src/pal/src/config.h.in | 2 ++ src/pal/src/configure.cmake | 2 ++ src/pal/src/thread/context.cpp | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pal/src/config.h.in b/src/pal/src/config.h.in index f132b13..a21910f 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 7817873..ab5a51d 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 2165616..1f48080 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 +#endif // HAVE_MACHINE_REG_H +#if HAVE_MACHINE_NPX_H #include -#endif // HAVE_BSD_REGS_T +#endif // HAVE_MACHINE_NPX_H + #if HAVE_PT_REGS #include #endif // HAVE_PT_REGS -- 2.7.4