Commit Graph

6 Commits

Author SHA1 Message Date
Rohan Singh
67ceabaf75 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.
2015-11-18 02:54:37 +00:00
Bob Nystrom
0f932e1f3a fix: make UNREACHABLE() macro safe on compilers lacking __builtin_unreachable
Add fallback empty UNREACHABLE() definition for GCC < 4.5 and non-MSVC compilers, and insert return/break statements after all UNREACHABLE() calls to prevent -Wreturn-type warnings when the macro expands to nothing. Also cast malloc result to char* in io.c to suppress C++ compilation warning.
2015-10-17 04:51:30 +00:00
Bob Nystrom
9e6f778147 feat: add Stdin class with readLine and async stdin read support in io module 2015-10-17 04:05:24 +00:00
Bob Nystrom
8fd9449196 feat: implement async file I/O with open/close/readBytes and scheduler error handling
Add foreign class File with static open, read, size methods and instance methods for close, size, readBytes. Implement async file operations using libuv callbacks that resume fibers on completion. Introduce schedulerResumeError and resumeError_ to propagate I/O errors as fiber errors. Add setExitCode to CLI vm for runtime error exit handling. Bump MAX_METHODS_PER_CLASS from 2 to 9 to accommodate new File methods.
2015-10-01 04:13:36 +00:00
Bob Nystrom
dbddd15e29 refactor: replace per-module bind functions with centralized ModuleRegistry table in modules.c 2015-09-21 14:58:39 +00:00
Bob Nystrom
e4cac681a5 feat: add io module with File.size async stat and scheduler resume helpers
Introduce a new built-in "io" module exposing a File class with a static size(path) method that performs asynchronous filesystem stat via libuv. The method uses a foreign function startSize_ to initiate the stat request and resumes the calling fiber through the scheduler upon completion. Extend the scheduler with schedulerResumeDouble and schedulerResumeString to support resuming fibers with numeric or string results. Include the generated io.wren.inc source, update the Xcode project to compile io.c and io.wren.inc, register the module in modules.c, and add a test file verifying synchronous-style async size calls and error handling.
2015-09-16 14:34:49 +00:00