Explorar el Código

Mock out \*nix stuff for cached.cpp

gingerBill hace 1 año
padre
commit
666703f430
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      src/cached.cpp

+ 7 - 1
src/cached.cpp

@@ -115,7 +115,8 @@ gb_internal bool check_if_exists_directory_otherwise_create(String const &str) {
 #else
 	char const *str_c = alloc_cstring(permanent_allocator(), str);
 	if (!gb_file_exists(str_c)) {
-		return false;
+		int status = mkdir(str_c, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+		return status == 0;
 	}
 	return false;
 #endif
@@ -245,6 +246,11 @@ gb_internal bool try_cached_build(Checker *c, Array<String> const &args) {
 			}
 			array_add(&envs, str);
 		}
+	#else
+		char **curr_env = environ;
+		while (curr_env && *curr_env) {
+			array_add(&envs, make_string_c(*curr_env++));
+		}
 	#endif
 	}
 	array_sort(envs, string_cmp);