api: use macro for fmtmsg and ndbm ifdef