Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect macro definition on Windows #950

Closed
wants to merge 1 commit into from

Conversation

daviesrob
Copy link
Member

_POSIX_C_SOURCE should have been _XOPEN_SOURCE.
The value given to _POSIX_C_SOURCE caused the strdup() and M_PI definitions to disappear.

Not sure quite how Appveyor failed to spot this, but I think it may be because it builds with htslib in a subdirectory of samtools. It failed for me when they were in side-by-side directories.

_POSIX_C_SOURCE should have been _XOPEN_SOURCE.
The value given to _POSIX_C_SOURCE caused the strdup() and M_PI
definitions to disappear.  For some unknown reason, Appveyor builds
still worked despite this problem.
@jmarshall
Copy link
Member

Nice catch. I guess this explains samtools/htslib#707

@daviesrob
Copy link
Member Author

Yes. To add to the confusion, there are at least two sets of include files you can get with MSYS2. If you got them from mingw-w64-x86_64-headers-git (possibly via mingw-w64-x86_64-toolchain) then the build worked. This is the version that Appveyor uses. If you got them from msys2-runtime-devel you ended up with cygwin-style headers which are a bit more strict about POSIX versions and the build failed.

I only noticed because I happened to download the msys2 version.

@valeriuo
Copy link
Contributor

valeriuo commented Oct 5, 2018

Closed by 5708485

@valeriuo valeriuo closed this Oct 5, 2018
@daviesrob daviesrob deleted the win_fix branch October 9, 2018 15:12
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.

None yet

3 participants