Klist.h and kseq.h use calloc, realloc and memchr in static inline code, but if we wish to permit our external headers to be used from a C++ include then these all need explicit casts as "void *" doesn't work the same in C++ as in C.
It's tempting to use extern "C" in an #ifdef __cplusplus guard, but the nature of these pseudo-template klib headers is such that the code will be expanded up later inside a C++ file so the extern "C" doesn't solve it.
Klist.h and kseq.h use calloc, realloc and memchr in static inline code, but if we wish to permit our external headers to be used from a C++ include then these all need explicit casts as "void *" doesn't work the same in C++ as in C.
It's tempting to use
extern "C"
in an#ifdef __cplusplus
guard, but the nature of these pseudo-template klib headers is such that the code will be expanded up later inside a C++ file so the extern "C" doesn't solve it.See #1674 and #1682