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

Fix compilation on macOS #183

Closed
wants to merge 2 commits into from
Closed

Conversation

sdlyyxy
Copy link

@sdlyyxy sdlyyxy commented Jun 1, 2022

No description provided.

@resuna
Copy link
Member

resuna commented Jun 8, 2022

Technically these should really be included unconditionally, since they're standard headers.

@sdlyyxy
Copy link
Author

sdlyyxy commented Jun 9, 2022

Technically these should really be included unconditionally, since they're standard headers.

Hi resuna, thank you for your comment. I checked the man page of these two headers. <strings.h> is in POSIX standard. For <alloca.h>, though it is not part of Standard C or any POSIX standard, it is actually available on many OS/compilers. Changed to unconditional inclusion.

@mutability
Copy link

Thanks for the PR! I will probably go with removing the use of alloca entirely instead (it's the only use of it in the source tree)

@mutability
Copy link

What's the failure that requires strings.h? (strcasecmp, I'm guessing?)

@mutability
Copy link

Could you check if #185 works for you?

@sdlyyxy
Copy link
Author

sdlyyxy commented Jun 9, 2022

Thanks for the PR! I will probably go with removing the use of alloca entirely instead (it's the only use of it in the source tree)

I agree!

@sdlyyxy
Copy link
Author

sdlyyxy commented Jun 9, 2022

What's the failure that requires strings.h? (strcasecmp, I'm guessing?)

Yes...

@sdlyyxy
Copy link
Author

sdlyyxy commented Jun 9, 2022

Could you check if #185 works for you?

Yes, it works well on my M1 Mac. I noticed #181, the problem is probably that libusb is not located at standard library search path. On my system, libusb's dylib installed by Homebrew cannot be found without manually setting LDFLAGS="-L/opt/homebrew/lib" environment variable.

@resuna
Copy link
Member

resuna commented Jun 10, 2022

Yeh, alloca is a gcc thing but since pretty much every compiler is based on gcc or clang these days ...

Anyway, Oliver has a separate pull request for this that replaces alloca with malloc, and I think we're going with that.

Good to know on the libusb thing. I have requested an M1 laptop from work but my current laptop is a 2019 MBP so I don't think I'm going to get a refresh this year.

@sdlyyxy
Copy link
Author

sdlyyxy commented Jun 14, 2022

Glad to use Oliver's PR. Closing this one. 👍

@sdlyyxy sdlyyxy closed this Jun 14, 2022
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.

None yet

3 participants