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.

fix: resolve compiler warnings in fs.c, buffer.c, and compat.h

- Add (void)mode to silence unused variable warning on Windows in mkdirSync
- Add S_IFLNK and S_ISLNK compat macros for platforms missing them
- Use uintptr_t instead of unsigned long in ANT_PTR macro to fix pointer-to-int cast warnings on 64-bit Windows

+10 -1
+1 -1
include/ant.h
··· 14 14 #define STR_PROTO_LEN 9 15 15 16 16 #define ANT_STRING(s) js_mkstr(js, s, sizeof(s) - 1) 17 - #define ANT_PTR(ptr) js_mknum((unsigned long)(ptr)) 17 + #define ANT_PTR(ptr) js_mknum((uintptr_t)(ptr)) 18 18 #define ANT_COPY(buf, len, s) cpy(buf, len, s, sizeof(s) - 1) 19 19 20 20 struct js;
+8
include/compat.h
··· 124 124 typedef unsigned int uid_t; 125 125 typedef unsigned int gid_t; 126 126 127 + #ifndef S_IFLNK 128 + #define S_IFLNK 0120000 129 + #endif 130 + 131 + #ifndef S_ISLNK 132 + #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) 133 + #endif 134 + 127 135 #else 128 136 #include <unistd.h> 129 137 #include <libgen.h>
+1
src/modules/fs.c
··· 821 821 if (!path_cstr) return js_mkerr(js, "Out of memory"); 822 822 823 823 #ifdef _WIN32 824 + (void)mode; 824 825 int result = _mkdir(path_cstr); 825 826 #else 826 827 int result = mkdir(path_cstr, mode);