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

all: C++ compiler support

This commit is contained in:
Uwe Krüger
2020-05-18 15:51:36 +02:00
committed by GitHub
parent 857276e81f
commit 9a237c3e82
32 changed files with 268 additions and 150 deletions

View File

@@ -76,23 +76,18 @@ pub enum FormatDelimiter {
no_delimiter
}
// TODO: C.time_t. works in v2
type time_t voidptr
pub struct C.timeval {
tv_sec u64
tv_usec u64
}
fn C.localtime(int) &C.tm
fn C.time(int) time_t
fn C.localtime(t &C.time_t) &C.tm
fn C.time(t &C.time_t) C.time_t
// now returns current local time.
pub fn now() Time {
t := C.time(0)
mut now := &C.tm(0)
now = C.localtime(&t)
now := C.localtime(&t)
return convert_ctime(now)
}