mirror of
				https://github.com/janet-lang/janet
				synced 2025-10-31 07:33:01 +00:00 
			
		
		
		
	Fix compiler warnings on emscripten.
This commit is contained in:
		| @@ -99,6 +99,14 @@ static Janet makef(FILE *f, int flags) { | ||||
| } | ||||
|  | ||||
| /* Open a process */ | ||||
| #ifdef __EMSCRIPTEN__ | ||||
| static Janet janet_io_popen(int32_t argc, Janet *argv) { | ||||
|     (void) argc; | ||||
|     (void) argv; | ||||
|     janet_panic("not implemented on this platform"); | ||||
|     return janet_wrap_nil(); | ||||
| } | ||||
| #else | ||||
| static Janet janet_io_popen(int32_t argc, Janet *argv) { | ||||
|     janet_arity(argc, 1, 2); | ||||
|     const uint8_t *fname = janet_getstring(argv, 0); | ||||
| @@ -115,9 +123,6 @@ static Janet janet_io_popen(int32_t argc, Janet *argv) { | ||||
|         : IO_PIPED | IO_READ; | ||||
| #ifdef JANET_WINDOWS | ||||
| #define popen _popen | ||||
| #endif | ||||
| #ifdef __EMSCRIPTEN__ | ||||
| #define popen(A, B) (errno = 0, NULL) | ||||
| #endif | ||||
|     FILE *f = popen((const char *)fname, (const char *)fmode); | ||||
|     if (!f) { | ||||
| @@ -125,6 +130,7 @@ static Janet janet_io_popen(int32_t argc, Janet *argv) { | ||||
|     } | ||||
|     return makef(f, flags); | ||||
| } | ||||
| #endif | ||||
|  | ||||
| /* Open a a file and return a userdata wrapper around the C file API. */ | ||||
| static Janet janet_io_fopen(int32_t argc, Janet *argv) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Calvin Rose
					Calvin Rose