atomicobject / heatshrink

data compression library for embedded/real-time systems
ISC License
1.33k stars 180 forks source link

Fix compilation on Fedora #6

Closed dashesy closed 9 years ago

dashesy commented 10 years ago

In order to use getopt

To fix I just had to add this line to the beginning of heatshrink.c

define _XOPEN_SOURCE

The manpage also mentions this: http://linux.die.net/man/3/optarg

silentbicycle commented 10 years ago

This is a Linux-ism. The current setup is actually correct according to the POSIX standard, which puts getopt in unistd.h. It looks like defining _POSIX_C_SOURCE >= 2 may be more correct. I want to double-check before adding distro-specific patches and other things that break it elsewhere, since heatshrink will be running in many unusual environments. It's easily patched locally, though.

silentbicycle commented 9 years ago

This should now be resolved via #10 and #12 .