vgmrips / vgmplay-legacy

VGM file command-line player and Winamp plugin.
http://vgmrips.net
221 stars 52 forks source link

Improve BSD support #71

Closed tatokis closed 4 years ago

tatokis commented 4 years ago

This PR fixes a few issues that prevented vgmplay from compiling without errors under FreeBSD (and possibly others).

Previously #include <linux/soundcard.h> would be included as long as the OS wasn't macOS/NetBSD/OpenBSD, causing problems for other BSDs, and unnecessarily be included for Linux libao builds. Now, that, and the NetBSD equivalent are only included if libao isn't used (as libao works on both NetBSD and FreeBSD if desired).

Additionally, BSD sed isn't compatible with GNU sed, so instead of copying the file and using sed -i to modify it in place, sed is now ran on the original file and the output is piped to the new file.

Finally, there was a missing unistd.h include that would result in an undefined warning for usleep.