Commit 8e32bebd authored by Brad King's avatar Brad King

Merge branch 'libuv-restore-fmode' into release-3.9

parents fdacfc66 871adefc
......@@ -27,6 +27,10 @@
#include <vector>
#ifdef CMAKE_USE_LIBUV
#ifdef _WIN32
#include <fcntl.h> /* _O_TEXT */
#include <stdlib.h> /* _set_fmode, _fmode */
#endif
#include "cm_uv.h"
#endif
......@@ -168,6 +172,18 @@ int main(int ac, char const* const* av)
ac = args.argc();
av = args.argv();
#if defined(CMAKE_USE_LIBUV) && defined(_WIN32)
// Perform libuv one-time initialization now, and then un-do its
// global _fmode setting so that using libuv does not change the
// default file text/binary mode. See libuv issue 840.
uv_loop_close(uv_default_loop());
#ifdef _MSC_VER
_set_fmode(_O_TEXT);
#else
_fmode = _O_TEXT;
#endif
#endif
cmSystemTools::EnableMSVCDebugHook();
cmSystemTools::FindCMakeResources(av[0]);
if (ac > 1) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment