utilities. This addresses PR standards/8027 by Giles Lean, who also submitted
a different implementation along with; I chose to add those files I had written
a while ago for reasons of portability and not requiring being cleaned up wrt.
compile-time warnings.