Skip to content

Avoid disabled typedef in FreeBSD-specific code#119

Merged
daviesrob merged 1 commit into
samtools:masterfrom
jmarshall:freebsd
May 16, 2024
Merged

Avoid disabled typedef in FreeBSD-specific code#119
daviesrob merged 1 commit into
samtools:masterfrom
jmarshall:freebsd

Conversation

@jmarshall

@jmarshall jmarshall commented May 14, 2024

Copy link
Copy Markdown
Member

Since 6dadc2a / samtools/htslib#1628, this code is compiled with _XOPEN_SOURCE set, usually to 600.

Setting this causes FreeBSD's <sys/types.h> not to define these old BSD-style typenames such as u_long. Happily we can just write it out as the corresponding native type — fortunately u_long's definition has not changed in 30+ years…

Setting _XOPEN_SOURCE causes FreeBSD's u_long not to be defined.
Write it out as the corresponding native type (fortunately u_long's
definition has been unchanged since 1994).
@daviesrob daviesrob self-assigned this May 16, 2024
@jmarshall

Copy link
Copy Markdown
Member Author

That is, when compiled via HTSlib's build infrastructure, rANS_static4x16pr.c gets compiled with _XOPEN_SOURCE and needs this patch. I haven't tested whether _XOPEN_SOURCE is set when htscodecs is compiled standalone using its own build infrastructure — but in any case, the patch won't hurt.

@daviesrob daviesrob merged commit 5a2627e into samtools:master May 16, 2024
@daviesrob

Copy link
Copy Markdown
Member

Thanks, the change looks fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants