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

sokol.sapp: fix compilation of gg apps with -prod (add typedef tags to Sokol's C struct declarations)

This commit is contained in:
Delyan Angelov 2022-10-02 12:10:03 +03:00
parent 35368b5721
commit ed2960a20e
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -7,6 +7,7 @@ const (
max_iconimages = 8 max_iconimages = 8
) )
[typedef]
pub struct C.sapp_range { pub struct C.sapp_range {
pub: pub:
ptr voidptr ptr voidptr
@ -15,6 +16,7 @@ pub:
pub type Range = C.sapp_range pub type Range = C.sapp_range
[typedef]
pub struct C.sapp_image_desc { pub struct C.sapp_image_desc {
pub: pub:
width int width int
@ -24,6 +26,7 @@ pub:
pub type ImageDesc = C.sapp_image_desc pub type ImageDesc = C.sapp_image_desc
[typedef]
pub struct C.sapp_icon_desc { pub struct C.sapp_icon_desc {
sokol_default bool sokol_default bool
images [max_iconimages]ImageDesc images [max_iconimages]ImageDesc
@ -31,6 +34,7 @@ pub struct C.sapp_icon_desc {
pub type IconDesc = C.sapp_icon_desc pub type IconDesc = C.sapp_icon_desc
[typedef]
pub struct C.sapp_desc { pub struct C.sapp_desc {
pub: pub:
init_cb fn () // these are the user-provided callbacks without user data init_cb fn () // these are the user-provided callbacks without user data
@ -77,6 +81,7 @@ pub:
pub type Desc = C.sapp_desc pub type Desc = C.sapp_desc
[typedef]
pub struct C.sapp_event { pub struct C.sapp_event {
pub: pub:
frame_count u64 frame_count u64
@ -103,10 +108,10 @@ pub:
pub type Event = C.sapp_event pub type Event = C.sapp_event
pub fn (e &C.sapp_event) str() string { pub fn (e &C.sapp_event) str() string {
t := e.@type return 'evt: frame_count=$e.frame_count, type=${e.@type}'
return 'evt: frame_count=$e.frame_count, type=$t'
} }
[typedef]
pub struct C.sapp_touchpoint { pub struct C.sapp_touchpoint {
pub: pub:
identifier u64 identifier u64