feat: add MSVC 2013 project files and fix io.c for Windows build

Add Visual Studio 2013 solution and project files under util/msvc2013/ for both wren CLI and wren_lib static library, including proper source file filters and include paths. Update .gitignore to allow the new project directories while still ignoring Debug/Release outputs. Fix io.c to include <fcntl.h> on _WIN32 for O_RDONLY definition, replace S_IRUSR with 0 for cross-platform uv_fs_open compatibility, and correct uv_buf_t access to use request->fs.info.bufs for libuv API changes. Remove references to wren_io.c and wren_meta.c from the library project, replacing them with wren_opt_meta.c and wren_opt_random.c from the new optional source directory.
This commit is contained in:
Rohan Singh
2015-11-18 02:54:37 +00:00
parent e5da0ecddf
commit 67ceabaf75
6 changed files with 203 additions and 18 deletions
+6 -2
View File
@@ -9,6 +9,10 @@
#include <stdio.h>
#ifdef _WIN32
#include <fcntl.h>
#endif
static const int stdinDescriptor = 0;
// Handle to Stdin.onData_(). Called when libuv provides data on stdin.
@@ -111,7 +115,7 @@ void fileOpen(WrenVM* vm)
uv_fs_t* request = createRequest(wrenGetArgumentValue(vm, 2));
// TODO: Allow controlling flags and modes.
uv_fs_open(getLoop(), request, path, O_RDONLY, S_IRUSR, openCallback);
uv_fs_open(getLoop(), request, path, O_RDONLY, 0, openCallback);
}
// Called by libuv when the stat call for size completes.
@@ -171,7 +175,7 @@ static void fileReadBytesCallback(uv_fs_t* request)
{
if (handleRequestError(request)) return;
uv_buf_t buffer = request->bufs[0];
uv_buf_t buffer = request->fs.info.bufs[0];
WrenValue* fiber = freeRequest(request);
// TODO: Having to copy the bytes here is a drag. It would be good if Wren's