cgen: fix msvc CI failure on `static struct _name_table[] = {}`, by skipping static for now
parent
80d12f6795
commit
6115db4820
|
@ -5626,7 +5626,15 @@ fn (mut g Gen) interface_table() string {
|
||||||
// generate an array of the interface methods for the structs using the interface
|
// generate an array of the interface methods for the structs using the interface
|
||||||
// as well as case functions from the struct to the interface
|
// as well as case functions from the struct to the interface
|
||||||
mut methods_struct := strings.new_builder(100)
|
mut methods_struct := strings.new_builder(100)
|
||||||
methods_struct.writeln('static $methods_struct_name ${interface_name}_name_table[$inter_info.types.len] = {')
|
mut staticprefix := 'static'
|
||||||
|
if g.pref.ccompiler == 'msvc' {
|
||||||
|
// msvc can not process `static struct x[0] = {};`
|
||||||
|
// for now just skip adding `static`.
|
||||||
|
// TODO: generate a non empty _name_table in this case,
|
||||||
|
// a dummy element...
|
||||||
|
staticprefix = ''
|
||||||
|
}
|
||||||
|
methods_struct.writeln('$staticprefix $methods_struct_name ${interface_name}_name_table[$inter_info.types.len] = {')
|
||||||
mut cast_functions := strings.new_builder(100)
|
mut cast_functions := strings.new_builder(100)
|
||||||
cast_functions.write('// Casting functions for interface "$interface_name"')
|
cast_functions.write('// Casting functions for interface "$interface_name"')
|
||||||
mut methods_wrapper := strings.new_builder(100)
|
mut methods_wrapper := strings.new_builder(100)
|
||||||
|
|
Loading…
Reference in New Issue