1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

add MSVC C backend support; fix live code reloading on Windows; other Windows fixes

This commit is contained in:
Emily Hudson
2019-07-23 22:23:13 +01:00
committed by Alexander Medvednikov
parent 3cf8e18cf6
commit e25ea7f9dd
9 changed files with 1231 additions and 42 deletions

View File

@@ -6,8 +6,8 @@ module os
#include <sys/stat.h>
#include <signal.h>
#include <unistd.h>
#include <errno.h>
//#include <execinfo.h> // for backtrace_symbols_fd
/*
@@ -340,6 +340,11 @@ pub fn dir_exists(path string) bool {
pub fn mkdir(path string) {
$if windows {
path = path.replace('/', '\\')
// Windows doesnt recursively create the folders
// so we need to help it out here
if path.last_index('\\') != -1 {
mkdir(path.all_before_last('\\'))
}
C.CreateDirectory(path.str, 0)
}
$else {
@@ -480,7 +485,10 @@ pub fn user_os() string {
}
$if dragonfly {
return 'dragonfly'
}
}
// $if msvc {
// return 'windows'
// }
return 'unknown'
}

View File

@@ -1,6 +1,7 @@
module os
#include <dirent.h>
#include <unistd.h>
const (
PathSeparator = '/'