Add unistd.h include to hts.c now that it used R_OK#1143
Add unistd.h include to hts.c now that it used R_OK#1143jkbonfield merged 1 commit intosamtools:developfrom andrewpatto:develop
Conversation
Include unistd to guarantee acccess to R_OK definition
|
I should add that the the rust-htslib compile bound to the previous release of htslib did compile so this is something introduced in the latest release |
|
On linux it looks to come via zlib.h -> zconf.h -> unistd.h. Yes, we should be including it explicitly. Thanks. (Edit: I don't understand how it works by itself, but not via rust-htslib, but I assume that's something else changed such as a different zlib. Anyway the point is valid.) |
|
POSIX does indeed specify that It happens to come the same way on macOS; probably when compiling via Rust a different subset of the platform predefines that control whether zconf.h activates its |
Include unistd to guarantee access to R_OK definition.
On a mac (Xcode 11) - when compiling via rust-htslib - I get a compile error about missing R_OK. As far as I can tell R_OK is defined officially in unistd.h, but probably comes in via other includes.
htslib by itself compiles fine on my mac - so I realise this is not specifically a htslib problem - presumably papered over a bit by the autoconf system.
The only other spot in htslib that used R_OK does include unistd (cram/cram_io.c)