Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miniaudio module broken, C structs apparently interfere with V's stdlib #16

Closed
ttytm opened this issue Oct 22, 2023 · 7 comments
Closed

Comments

@ttytm
Copy link

ttytm commented Oct 22, 2023

Thanks a lot for the module @larpon!

At some point in the recent past It must have broken.
E.g., I was using it in an app. Now I can't successfully compile it anymore due to an error from miniaudio.

Trying to compile it results in:

/opt/hostedtoolcache/v/0.4.2/x64/vlib/sync/sync_default.c.v:52:8: error: struct `C.pthread_mutex_t` was declared as private to module `miniaudio`, so it can not be used inside module `sync`
   50 | [heap]
   51 | pub struct Mutex {
   52 |     mutex C.pthread_mutex_t
      |           ~~~~~~~~~~~~~~~~~
   53 | }
   54 |
Error: Process completed with exit code 1.

Ref.: https://github.com/ttytm/emoji-mart-desktop/actions/runs/6599637443/job/17928908286

Looks like the C struct clashes with the struct in sync, though I'm not actively importing or using sync in the app.

@larpon
Copy link
Owner

larpon commented Oct 22, 2023

Glad you find it useful.

Yeah this period is a tough time for old C bindings 😅

I think it can simply be fixed by making one of the definitions pub - I'll have a look ASAP

@larpon
Copy link
Owner

larpon commented Oct 23, 2023

@ttytm - I've just pushed e706fed which should fix the problem.

@larpon larpon closed this as completed Oct 23, 2023
@ttytm
Copy link
Author

ttytm commented Oct 24, 2023

Thanks for the update @larpon.

With the latest changes when trying to built with miniaudio I'm now running into:

/tmp/v_1000/emoji-mart-desktop.5277448590780964038.tmp.c:4304: error: field 'mutex' has incomplete type
builder error: 
==================
C error. This should never happen.

@larpon
Copy link
Owner

larpon commented Oct 24, 2023

Oh dear, I'll have a look and see if I can replicate the error locally later

@larpon larpon reopened this Oct 24, 2023
@larpon
Copy link
Owner

larpon commented Oct 25, 2023

Right I've made a PR vlang/v#19651 that should fix V's side of the problem (for now).
And have updated miniaudio to match V's sync module's definition of the struct in 3594e83

@larpon
Copy link
Owner

larpon commented Oct 25, 2023

V PR has been merged - it should work again 👍

@larpon larpon closed this as completed Oct 25, 2023
@ttytm
Copy link
Author

ttytm commented Oct 25, 2023

Awesome! It works thanks @larpon !

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

No branches or pull requests

2 participants