samtools/samtools — pull request #9 by peterjc (2012-06-12 14:52:12+00:00)
Title: Fix missing declaration for getopt on Mac OS X

Several files are missing this include which prevents compilation on Mac OS X,

#include

e.g.

$ make
...
gcc -c -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_tview.c -o bam_tview.o
bam_tview.c: In function ‘bam_tview_main’:
bam_tview.c:462: warning: implicit declaration of function ‘getopt’
bam_tview.c:464: error: ‘optarg’ undeclared (first use in this function)
bam_tview.c:464: error: (Each undeclared identifier is reported only once
bam_tview.c:464: error: for each function it appears in.)
bam_tview.c:468: error: ‘optind’ undeclared (first use in this function)
make[1]: *** [bam_tview.o] Error 1
make: *** [all-recur] Error 1