3 base=openbsd-sigcontext
5 # check for sf_fpstate in struct sigframe (ie: pre July 2010)
7 cat > "${base}.c" <<EOF
10 #include <machine/frame.h>
14 printf("it works: %d\n", offsetof(struct sigframe, sf_fpstate));
18 if $GNUMAKE "${base}" > /dev/null 2>&1 && "./${base}" > /dev/null 2>&1
20 echo '#define OS_OPENBSD_FPSTATE_IN_SIGFRAME'
23 # check for sc_fpstate in struct sigcontext (ie: July 2010 and later)
25 cat > "${base}.c" <<EOF
32 printf("it works: %d\n", offsetof(struct sigcontext, sc_fpstate));
36 if $GNUMAKE "${base}" > /dev/null 2>&1 && "./${base}" > /dev/null 2>&1
38 echo '#define OS_OPENBSD_FPSTATE_IN_SIGCONTEXT'
41 rm -f "${base}.c" "${base}"