sbooth / SFBAudioEngine

A powerhouse of audio functionality for macOS and iOS
https://sbooth.github.io/SFBAudioEngine/
MIT License
552 stars 87 forks source link

Missing variable declaration (paramErr)? #175

Closed edwellbrook closed 3 years ago

edwellbrook commented 3 years ago

Hey there!

Thanks so much for your work on SFBAudioEngine and for providing it as open source software. I'm still trying out the project but it looks ideal for my use case.

I've tried compiling the project (after some minor tweaks which I'll address separately) and have run into an issue around a missing variable declaration.

In some places throughout the project you use:

[NSError errorWithDomain:NSOSStatusErrorDomain code:paramErr userInfo:nil];

However paramErr is undefined.

After a search in the project and on GitHub as well (https://github.com/sbooth/SFBAudioEngine/search?q=paramErr), it seems the value isn't provided anywhere.

Thanks!

edwellbrook commented 3 years ago

Looking into this a little further, it seems the project compiles correctly for macOS, however the missing variable errors appear only on iOS.

I can see paramErr is a constant, and by @importing CoreServices in the files where we reference these errors the problem goes away.

I'll shortly open a PR to include an import to CoreServices.

Separately to this, do you have any plans to set up CI / some automated testing for PRs? Would love to make sure the project continues to compile correctly for iOS going forward.

Thanks!

edwellbrook commented 3 years ago

Quick update, importing CoreServices on iOS doesn't actually solve the problem. paramErr and ioErr are part of Carbon and aren't available on iOS (as far as I know).

Given that — how would you suggest I approach fixing this?

sbooth commented 3 years ago

I didn't realize that all of those (old) error codes were deprecated. I just merged a PR that removes their use.

I'd like to implement CI of some sort but I've run into problems compiling all the dependencies. I do build manually before merging PRs but in this case it seems something slipped through the cracks.