Added -D_DARWIN_C_SOURCE=1 to compiler flags to ensure non-default extensions, including snprintf defined.