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

compiler: stage 2 of vhash support

This commit is contained in:
Delyan Angelov
2019-09-11 01:12:46 +03:00
committed by Alexander Medvednikov
parent a53c69de38
commit bc606415c3
2 changed files with 7 additions and 11 deletions

View File

@ -105,8 +105,8 @@ fn main() {
args := env_vflags_and_os_args()
// Print the version and exit.
if '-v' in args || '--version' in args || 'version' in args {
versionhash := vhash()
println('V $Version $versionhash')
version_hash := vhash()
println('V $Version $version_hash')
return
}
if '-h' in args || '--help' in args || 'help' in args {
@ -1018,13 +1018,9 @@ pub fn cerror(s string) {
exit(1)
}
// TODO: this must be uncommented on stage 2, after V_COMMIT_HASH is always present and preserved
fn vhash() string {
/*
mut buf := [50]byte
buf[0] = 0
C.snprintf(buf, 50, '%s', C.V_COMMIT_HASH )
return tos_clone(buf)
*/
return '0000000'
return tos_clone(buf)
}