MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

squash win32 fixes into one commit

+57 -10
+4
src/modules/child_process.c
··· 388 388 static void alloc_buffer(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) { 389 389 (void)handle; 390 390 buf->base = malloc(suggested_size); 391 + #ifdef _WIN32 392 + buf->len = buf->base ? (ULONG)(suggested_size > (size_t)ULONG_MAX ? ULONG_MAX : suggested_size) : 0; 393 + #else 391 394 buf->len = buf->base ? suggested_size : 0; 395 + #endif 392 396 } 393 397 394 398 static void on_stdout_read(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) {
+8
src/modules/date.c
··· 180 180 } 181 181 182 182 ti = (time_t)time_s; 183 + #ifdef _WIN32 184 + localtime_s(&tm_local, &ti); 185 + #else 183 186 localtime_r(&ti, &tm_local); 187 + #endif 184 188 185 189 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__GLIBC__) 186 190 return (int)(-tm_local.tm_gmtoff / 60); 187 191 #else 188 192 struct tm tm_gmt; 193 + #ifdef _WIN32 194 + gmtime_s(&tm_gmt, &ti); 195 + #else 189 196 gmtime_r(&ti, &tm_gmt); 197 + #endif 190 198 tm_local.tm_isdst = 0; 191 199 return (int)(difftime(mktime(&tm_gmt), mktime(&tm_local)) / 60); 192 200 #endif
+19 -10
src/modules/fs.c
··· 629 629 return (double)ts.tv_sec * 1000.0 + (double)ts.tv_nsec / 1e6; 630 630 } 631 631 632 - #ifdef __APPLE__ 632 + #ifdef _WIN32 633 + #define POSIX_ATIME_MS(st) ((double)(st)->st_atime * 1000.0) 634 + #define POSIX_MTIME_MS(st) ((double)(st)->st_mtime * 1000.0) 635 + #define POSIX_CTIME_MS(st) ((double)(st)->st_ctime * 1000.0) 636 + #define POSIX_BIRTH_MS(st) 0.0 637 + #elif defined(__APPLE__) 633 638 #define POSIX_ATIME_MS(st) posix_ts_to_ms((st)->st_atimespec) 634 639 #define POSIX_MTIME_MS(st) posix_ts_to_ms((st)->st_mtimespec) 635 640 #define POSIX_CTIME_MS(st) posix_ts_to_ms((st)->st_ctimespec) ··· 2553 2558 char *path_cstr = strndup(path, path_len); 2554 2559 if (!path_cstr) return js_mkerr(js, "Out of memory"); 2555 2560 2556 - struct stat st; 2557 - int result = lstat(path_cstr, &st); 2558 - 2559 - if (result != 0) { 2560 - const char *code = errno_to_code(errno); 2561 - ant_value_t err = fs_err_code(js, code, "lstat", path_cstr); 2562 - free(path_cstr); return err; 2561 + uv_fs_t req; 2562 + int result = uv_fs_lstat(NULL, &req, path_cstr, NULL); 2563 + 2564 + if (result < 0) { 2565 + ant_value_t err = fs_err_code(js, uv_err_name(result), "lstat", path_cstr); 2566 + uv_fs_req_cleanup(&req); 2567 + free(path_cstr); 2568 + return err; 2563 2569 } 2570 + 2571 + ant_value_t stat_obj = fs_stats_object_from_uv(js, &req.statbuf); 2572 + uv_fs_req_cleanup(&req); 2573 + free(path_cstr); 2564 2574 2565 - free(path_cstr); 2566 - return create_stats_object(js, &st); 2575 + return stat_obj; 2567 2576 } 2568 2577 2569 2578 static ant_value_t builtin_fs_lstat(ant_t *js, ant_value_t *args, int nargs) {
+6
src/modules/globals.c
··· 1 + #include <compat.h> // IWYU pragma: keep 2 + 1 3 #include <string.h> 2 4 #include <stdio.h> 3 5 #include <stdlib.h> ··· 110 112 } else t = time(NULL); 111 113 112 114 struct tm local; 115 + #ifdef _WIN32 116 + localtime_s(&local, &t); 117 + #else 113 118 localtime_r(&t, &local); 119 + #endif 114 120 115 121 char buf[64]; 116 122 int hour12 = local.tm_hour % 12;
+1
vendor/boringssl.wrap
··· 2 2 url = https://github.com/google/boringssl.git 3 3 revision = 297b11798a0ed6bc7736aa57328909a4afbbf67a 4 4 depth = 1 5 + diff_files = patches/boringssl-disable-bssl-on-windows.patch
+19
vendor/packagefiles/patches/boringssl-disable-bssl-on-windows.patch
··· 1 + --- a/CMakeLists.txt 2 + +++ b/CMakeLists.txt 3 + @@ -765,8 +765,6 @@ 4 + target_link_libraries(entropy_modulewrapper crypto) 5 + endif() 6 + 7 + -add_executable(bssl ${BSSL_SOURCES}) 8 + -target_link_libraries(bssl ssl crypto) 9 + 10 + if(BUILD_TESTING) 11 + add_executable(generate_mldsa_certs pki/testdata/verify_unittest/generate_mldsa_certs.cc) 12 + @@ -865,7 +863,6 @@ 13 + 14 + if(INSTALL_ENABLED) 15 + install(TARGETS crypto ssl EXPORT OpenSSLTargets) 16 + - install(TARGETS bssl) 17 + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) 18 + install(EXPORT OpenSSLTargets 19 + FILE OpenSSLTargets.cmake