Add support for MacOS. Thanks to return <mr_j.c.h@hotmail.com>!