LonnyGomes / hexcurse

Hexcurse is a ncurses-based console hexeditor written in C
Other
180 stars 17 forks source link

Simplify alloca() usage #19

Closed fornwall closed 9 years ago

fornwall commented 9 years ago

This fixes compilation with Android NDK.

This is another variant than https://github.com/LonnyGomes/hexcurse/pull/18, which instead replaced alloca with malloc and free.

This change simplifies alloca() usage, since the current existing approach does not work with Android where alloca() is a macro and no alloca() function exists, unlike e.g. in glibc.

Is there any benefit to continue with __alloca as a macro for other platforms instead of the simpler approach in this pull request (which is the way described by http://linux.die.net/man/3/alloca and other resources)? In that case the Android build could be fixed with even more ifdef:s..

ghost commented 9 years ago

Ended up going with #18 after I was able to sit down and take a look at the file. Closing this one out.