It might be worth importing, or at least tracking references to, https://github.com/tsutsui/emacs-18.59-netbsd.git . The code overall has been brought up to at least c89 standards and seems to include any patches I ever made (or perhaps they were coded independently) and then some.