With this it compiles and runs under OpenBSD. I still need to do some more testing but I think this is good to go.
This was originally from #3581737 but apparently I cannot add another file to the report so opening a new one.
Please let me know. Thanks.