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:

committed by
Alexander Medvednikov

parent
3cf8e18cf6
commit
e25ea7f9dd
12
vlib/os/os.v
12
vlib/os/os.v
@@ -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'
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
module os
|
||||
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
|
||||
const (
|
||||
PathSeparator = '/'
|
||||
|
Reference in New Issue
Block a user