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

include alloca.h only on Linux #107

Closed
wants to merge 1 commit into from

Conversation

Mischi
Copy link

@Mischi Mischi commented Aug 5, 2018

Hi.

This PR only includes the alloca.h header if compiled for Linux systems.

It appears that the alloca.h header is only available on Linux systems.
ALl BSD's and MacOS expose alloca through stdlib.h
Windows exposes alloca through malloc.h

The Windows part is from @fireflystorm via #104

I've tested this patch under OpenBSD and it works fine.

This should close the issues #80, #87, #104,

Cheers,
Fabian

References:
stdlib.h
http://man.openbsd.org/OpenBSD-6.3/alloca
http://man.openbsd.org/FreeBSD-11.1/alloca
http://man.openbsd.org/NetBSD-7.1/alloca
http://man.openbsd.org/DragonFly-4.8.0/alloca
https://www.unix.com/man-page/osx/3/alloca/
https://www.unix.com/man-page/opensolaris/3C/alloca/

alloca.h
http://man.openbsd.org/Linux-4.13/alloca

*BSD and MacOS expose alloca through stdlib.h
Windows expose alloca thourgh malloc.h
@Mischi
Copy link
Author

Mischi commented Aug 5, 2018

Just saw that all usages of alloca got removed by @xcthulhu in 950229a... The include could just be removed then. I will close this PR in favor of PR #105.

Thanks,
Fabian

@Mischi Mischi closed this Aug 5, 2018
@rayrapetyan
Copy link

rayrapetyan commented Dec 6, 2018

So after 4 years this nasty "alloca.h" is still there in core.c, which makes this module (and all depending modules) fail to install on anything except Linux.

Here is a list of related opened issues\PRs:
#104
#87
#80
#105

I've tried to remove #include "alloca.h" and it compiled fine on FreeBSD. As per #105 it works on Windows as well. Can someone try to remove it in Linux and confirm it compiles? After that we can finally drop it and close all issues\PRs above.

https://pypi.org/project/pyethash/ should be also updated after that.

Thanks.

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.

2 participants