Some people's programs use both HTSlib and libbwa.a — see e.g. samtools/htslib#693. Unfortunately one function — ksprintf — is defined in both libraries, leading to linker errors.
This happens for ksprintf only, because all the other functions in bwa's kstring.h are declared as static inline.
This PR makes ksprintf() static inline in kstring.h, so that it (like the other bwa/kstring.h functions) won't conflict with similar HTSlib functions. Instead implement it and a new kvsprintf() in terms of a new bwa_kvsprintf() function. Fixes samtools/htslib#693.
Some people's programs use both HTSlib and libbwa.a — see e.g. samtools/htslib#693. Unfortunately one function —
ksprintf
— is defined in both libraries, leading to linker errors.This happens for
ksprintf
only, because all the other functions in bwa's kstring.h are declared asstatic inline
.This PR makes
ksprintf()
static inline in kstring.h, so that it (like the other bwa/kstring.h functions) won't conflict with similar HTSlib functions. Instead implement it and a newkvsprintf()
in terms of a newbwa_kvsprintf()
function. Fixes samtools/htslib#693.