Skip to content

Commit

Permalink
Fix clang builds on Windows/mingw.
Browse files Browse the repository at this point in the history
If we use HTSLIB_EXPORT once, it has to be used everywhere for that symbol.

Also see samtools#1435
  • Loading branch information
jkbonfield committed Aug 15, 2022
1 parent 8f140ee commit b5cc0b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions htslib/ksort.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

#include <stdlib.h>
#include <string.h>
#include "hts.h"

#ifndef klib_unused
#if (defined __clang__ && __clang_major__ >= 3) || (defined __GNUC__ && __GNUC__ >= 3)
Expand All @@ -81,6 +82,7 @@ extern "C" {
// problems on Windows. Don't include htslib/hts_os.h for this as it
// may not get on with older attempts to fix this in code that includes
// this file.
HTSLIB_EXPORT
extern double hts_drand48(void);

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion htslib_vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ htslib_khash_str2int_h = $(HTSPREFIX)htslib/khash_str2int.h $(htslib_khash_h)
htslib_klist_h = $(HTSPREFIX)htslib/klist.h
htslib_kroundup_h = $(HTSPREFIX)htslib/kroundup.h
htslib_kseq_h = $(HTSPREFIX)htslib/kseq.h
htslib_ksort_h = $(HTSPREFIX)htslib/ksort.h
htslib_ksort_h = $(HTSPREFIX)htslib/ksort.h $(htslib_hts_h)
htslib_kstring_h = $(HTSPREFIX)htslib/kstring.h $(htslib_hts_defs_h) $(htslib_kroundup_h)
htslib_regidx_h = $(HTSPREFIX)htslib/regidx.h $(htslib_hts_h)
htslib_sam_h = $(HTSPREFIX)htslib/sam.h $(htslib_hts_h) $(htslib_hts_endian_h)
Expand Down

0 comments on commit b5cc0b7

Please sign in to comment.