_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
* Provide some GNUisms as extensions.
* Provide dynamically growable string space.
* Make define(defn(foo)) work correctly for builtins.
(The current version is supposed to be capable of satisfying autoconf.)
All still relevant NetBSD changes have been preserved in this version, and
formatting and style fixes have been applied in various places.
Thanks to Masao Uebayashi <uebayasi@soum.co.jp> for pointing this out.
it uses pbstr() instead of doing the characters individually (in
reverse order) with putback().
Fix dodiv() so that divert(<out-of-range stream>) doesn't cause "divnum" to
return 0, but rather the stream number specified to divert(). Macros
like PUSHDIVERT/POPDIVERT rely on this. The new behaviour is compatible
with vendor m4 implementations.