zhengxwen / gdsfmt

R Interface to CoreArray Genomic Data Structure (GDS) Files (Development version only)
http://www.bioconductor.org/packages/gdsfmt
18 stars 4 forks source link

Issue/bsd compatibility #16

Closed nathanweeks closed 7 years ago

nathanweeks commented 7 years ago

This pull request addresses a couple portability issues preventing successful compilation of gdsfmt.

The first should affect all BSDs, which use fseek()/lseek() instead of fseek64()/lseek64().

The second commit affects at least FreeBSD 10.3, which uses the LLVM libc++. In libc++, includes , which in turn includes . Since the inclusion of stdint.h is done before the __STDC_LIMIT_MACROS is defined in dType.h, we get a stdint.h without the INT_MIN/INT_MAX macros defined, causing a compilation failure.

An alternative workaround that appears to work on this platform is to specify the -std=c++11 option ("By default, Clang builds C++ code according to the C++98 standard..." -- https://clang.llvm.org/cxx_status.html)

I suspect this wouldn't be an issue with the LLVM >= 4.0 libc++, which added its own stdint.h that defines __STDC_LIMIT_MACROS (https://git.io/vSMy9)

zhengxwen commented 7 years ago

Thanks for letting me know the issue of BSD compatibility. It seems that I also have to use -D_FILE_OFFSET_BITS=64 in the make file, if lseek() is used instead of lseek64().