diff options
author | Bert Belder <bertbelder@gmail.com> | 2018-06-14 14:03:02 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-06-14 14:19:17 +0200 |
commit | fb98474239a7ffb145e529dbcf069866b2e9296e (patch) | |
tree | 624d60278a6a6221d6f73f42793aab5b2a9f57e0 | |
parent | a5f53c000a44b790474b3093ceb4fcb11389157d (diff) |
deno2: make getcwd() work on windows
-rw-r--r-- | deno2/main.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/deno2/main.cc b/deno2/main.cc index 342b957b9..2a10b8820 100644 --- a/deno2/main.cc +++ b/deno2/main.cc @@ -2,9 +2,14 @@ // All rights reserved. MIT License. #include <stdio.h> #include <stdlib.h> -#include <unistd.h> #include <string> +#ifdef _WIN32 +#include <direct.h> +#else +#include <unistd.h> +#endif + #include "./msg.pb.h" #include "include/deno.h" #include "v8/src/base/logging.h" @@ -19,6 +24,7 @@ void MessagesFromJS(Deno* d, const char* channel, deno_buf buf) { response.set_command(deno::Msg_Command_START); char cwdbuf[1024]; + // TODO(piscisaureus): support unicode on windows. std::string cwd(getcwd(cwdbuf, sizeof(cwdbuf))); response.set_start_cwd(cwd); |