mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
changelog for the upcoming V 0.1.19
This commit is contained in:
@ -13,7 +13,6 @@ CommonCHeaders = '
|
||||
|
||||
#define STRUCT_DEFAULT_VALUE {}
|
||||
#define EMPTY_STRUCT_DECLARATION
|
||||
#define EMPTY_STRUCT_INIT 0
|
||||
#define OPTION_CAST(x) (x)
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -36,8 +35,6 @@ CommonCHeaders = '
|
||||
#define STRUCT_DEFAULT_VALUE {0}
|
||||
#undef EMPTY_STRUCT_DECLARATION
|
||||
#define EMPTY_STRUCT_DECLARATION void *____dummy_variable;
|
||||
#undef EMPTY_STRUCT_INIT
|
||||
#define EMPTY_STRUCT_INIT 0
|
||||
#undef OPTION_CAST
|
||||
#define OPTION_CAST(x)
|
||||
#endif
|
||||
|
@ -2774,10 +2774,10 @@ fn (p mut Parser) array_init() string {
|
||||
}
|
||||
p.gen(' })')
|
||||
// p.gen('$new_arr($vals.len, $vals.len, sizeof($typ), ($typ[]) $c_arr );')
|
||||
// TODO why need !first_pass()?? Otherwise it goes to the very top of the out.c file
|
||||
// Need to do this in the second pass, otherwise it goes to the very top of the out.c file
|
||||
if !p.first_pass() {
|
||||
if i == 0 {
|
||||
p.cgen.set_placeholder(new_arr_ph, '$new_arr($i, $i, sizeof($typ), ($typ[]) {EMPTY_STRUCT_INIT ')
|
||||
p.cgen.set_placeholder(new_arr_ph, '$new_arr($i, $i, sizeof($typ), ($typ[]) { 0 ')
|
||||
} else {
|
||||
p.cgen.set_placeholder(new_arr_ph, '$new_arr($i, $i, sizeof($typ), ($typ[]) { ')
|
||||
}
|
||||
@ -2926,11 +2926,9 @@ fn (p mut Parser) struct_init(typ string, is_c_struct_init bool) string {
|
||||
}
|
||||
did_gen_something = true
|
||||
}
|
||||
|
||||
if !did_gen_something {
|
||||
p.gen('EMPTY_STRUCT_INIT')
|
||||
p.gen('0')
|
||||
}
|
||||
|
||||
p.gen('}')
|
||||
if ptr {
|
||||
p.gen(')')
|
||||
|
Reference in New Issue
Block a user