In 94cee4a4c2 I overlooked that config.h unconditionally sets _FILE_OFFSET_BITS, so it cannot be used to detect MinGW W64 environment. It looks like Emacs folks already found solution; instead of _FILE_OFFSET_BITS use _W64 as suggested in http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00723.html
94cee4a4c2