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

Change CGen so that v.c is compileable with msvc

This commit is contained in:
Emily Hudson
2019-07-24 16:46:41 +01:00
committed by Alexander Medvednikov
parent 41f4ec5a3b
commit 049d78a78d
4 changed files with 30 additions and 28 deletions

View File

@ -544,7 +544,7 @@ fn type_default(typ string) string {
}
// User struct defined in another module.
if typ.contains('__') {
return '{}'
return 'STRUCT_DEFAULT_VALUE'
}
// Default values for other types are not needed because of mandatory initialization
switch typ {
@ -566,7 +566,7 @@ fn type_default(typ string) string {
case 'byteptr': return '0'
case 'voidptr': return '0'
}
return '{}'
return 'STRUCT_DEFAULT_VALUE'
}
// TODO PERF O(n)