Skip to content

cgen: fix myarr [1]C.mytype fixed array fields, for pub type C.mytype = voidptr - #21266

Merged
spytheman merged 1 commit into
vlang:masterfrom
antono2:C_fixed_size_arr
Apr 24, 2024
Merged

spytheman merged 1 commit into
vlang:masterfrom
antono2:C_fixed_size_arr

Conversation

@antono2

@antono2 antono2 commented Apr 12, 2024

Copy link
Copy Markdown
Contributor

"C__" was removed for fixed size C. arrays and resulted in unknown type.
Fixed by removing the removal.

Not sure which tests are expected to fail, so please double check.

Cheers,
Anton

@felipensp

Copy link
Copy Markdown
Member

What code have you used to test?

@antono2

antono2 commented Apr 12, 2024

Copy link
Copy Markdown
Contributor Author

What code have you used to test?

I needed this fix for my vulkan bindings, but it's not public yet.

git clone git@github.com:antono2/tmp.git
cd tmp
~/workspace/v_fork/v run examples/vk_glfw.v

@Delta456

Copy link
Copy Markdown
Member

What code have you used to test?

I needed this fix for my vulkan bindings, but it's not public yet.

git clone git@github.com:antono2/tmp.git
cd tmp
~/workspace/v_fork/v run examples/vk_glfw.v

Can you add a minimal reproduction at least?

@antono2

antono2 commented Apr 12, 2024

Copy link
Copy Markdown
Contributor Author

Can you add a minimal reproduction at least?

pub type C.mytype = voidptr

pub struct MyStruct {
pub mut:
  myarr [1]C.mytype
}

pub fn main(){
}

Yeah, could have done that in the first place.

@spytheman

spytheman commented Apr 18, 2024 •

Copy link
Copy Markdown
Contributor

Yeah, could have done that in the first place.

Please do. You can just make another commit on the same branch, and push it, then it will be included in this PR.

@spytheman spytheman changed the title Fixed size arrays of C.vars fixed cgen: fix myarr [1]C.mytype fixed array fields, for pub type C.mytype = voidptr Apr 23, 2024

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman
spytheman merged commit 9ed3371 into vlang:master Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants