File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ typedef struct WGPU{{.Name | PascalCase}}CallbackInfo{{$.ExtSuffix}} {
312
312
/**
313
313
* Initializer for @ref WGPU{{.Name | PascalCase}}CallbackInfo{{$.ExtSuffix}}.
314
314
*/
315
- #define WGPU_{{.Name | ConstantCase}}_CALLBACK_INFO{{$.ExtSuffix}}_INIT _wgpu_MAKE_INIT_STRUCT(WGPU{{.Name | PascalCase}}CallbackInfo{{$.ExtSuffix}}, { \
315
+ #define WGPU_{{.Name | ConstantCase}}_CALLBACK_INFO{{if $.ExtSuffix}}_{{$.ExtSuffix}}{{end }}_INIT _wgpu_MAKE_INIT_STRUCT(WGPU{{.Name | PascalCase}}CallbackInfo{{$.ExtSuffix}}, { \
316
316
/*.nextInChain=*/NULL _wgpu_COMMA \
317
317
{{- if eq .Style "callback_mode" }}
318
318
/*.mode=*/WGPUCallbackMode_WaitAnyOnly _wgpu_COMMA \
Original file line number Diff line number Diff line change @@ -590,11 +590,11 @@ func (g *Generator) DefaultValue(member ParameterType, isDocString bool) string
590
590
return literal ("NULL" )
591
591
} else {
592
592
typ := strings .TrimPrefix (member .Type , "struct." )
593
- return ref ("WGPU_" + ConstantCase (typ ) + "_INIT" )
593
+ return ref ("WGPU_" + ConstantCase (typ ) + g . ConstantExtSuffix () + "_INIT" )
594
594
}
595
595
case strings .HasPrefix (member .Type , "callback." ):
596
596
typ := strings .TrimPrefix (member .Type , "callback." )
597
- return ref ("WGPU_" + ConstantCase (typ ) + "_CALLBACK_INFO_INIT " )
597
+ return ref ("WGPU_" + ConstantCase (typ ) + "_CALLBACK_INFO" + g . ConstantExtSuffix () + "_INIT " )
598
598
case strings .HasPrefix (member .Type , "object." ):
599
599
return literal ("NULL" )
600
600
case strings .HasPrefix (member .Type , "array<" ):
@@ -607,3 +607,11 @@ func (g *Generator) DefaultValue(member ParameterType, isDocString bool) string
607
607
panic ("invalid prefix: " + member .Type + " in member " + member .Name )
608
608
}
609
609
}
610
+
611
+ func (g * Generator ) ConstantExtSuffix () string {
612
+ if g .ExtSuffix != "" {
613
+ return "_" + ConstantCase (g .ExtSuffix )
614
+ } else {
615
+ return ""
616
+ }
617
+ }
You can’t perform that action at this time.
0 commit comments