lib/memory_mapped_file.cc used POSIX open/fstat/mmap, which does not
exist under mingw-w64, blocking a native Windows build of the prjxray
tools. Add an #ifdef _WIN32 branch using
CreateFileA/CreateFileMappingA/MapViewOfFile; the POSIX path is
byte-for-byte unchanged.
One behavioural note: a zero-length file cannot be mapped on Windows,
so that case returns an object with nullptr data and zero size to
preserve the "file exists" contract of InitWithFile.
mmap() will fail for a zero-length mapping. A valid object should still
be returned to signal that the file was opened to the caller but it
should have a nullptr for data and zero for size.
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>