Skip to content

Commit f542317

Browse files
authored
sokol: add explicit casts for g++ compatability (#26744)
* sokol: add explicit casts for g++ compatability * fix: use Backend struct instead of int
1 parent 08a86d7 commit f542317

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎vlib/sokol/gfx/gfx.c.v‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ pub fn query_desc() Desc {
179179

180180
@[inline]
181181
pub fn query_backend() Backend {
182-
return C.sg_query_backend()
182+
unsafe {
183+
return Backend(C.sg_query_backend())
184+
}
183185
}
184186

185187
@[inline]

‎vlib/sokol/sapp/sapp_structs.c.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ pub mut:
301301
pub type Event = C.sapp_event
302302

303303
pub fn (e &Event) str() string {
304-
return 'evt: frame_count=${e.frame_count}, type=${e.type}'
304+
return 'evt: frame_count=${e.frame_count}, type=${EventType(e.type)}'
305305
}
306306

307307
@[typedef]

0 commit comments

Comments
 (0)