Issue #15 - Guard #include <unistd.h> in planarityCommandLine.c based on compiler#18
Merged
john-boyer-phd merged 1 commit intomasterfrom Feb 22, 2026
Merged
Conversation
…dLine.c and guard the include of unistd.h when using MSVC cl (which is the default compiler toolchain assumed by Python's setuptools on Windows)
Member
Author
Fix confirmed on MacOSBefore fix: After fix: Fix confirmed on Windows using Python setuptools default compiler choice of MSVC clBefore fix: After fix: Fix confirmed on Windows (overriding MSVC cl default compiler to use MSYS2 UCRT64 MinGW-w64 gcc)Before fix: After fix: |
john-boyer-phd
approved these changes
Feb 22, 2026
Member
john-boyer-phd
left a comment
There was a problem hiding this comment.
Yes, this is what we need to restore link-ability of the HEAD code for all OS's, and also fix the unistd problem if someone is using the Microsoft compiler (which is what python/cython use by default). Later, we can upgrade to the 4.x edge addition planarity code and at that time remove all planarityApp layer files, but best to get the HEAD code building and linking first. I have tested this from the branch, and it is all working for me too now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #15 (and #17 )
Fix details
Since
planarityCommandLine.crequiredgetcwd()andchdir()fromunistd.h, I determined the header in which equivalent functions were declared in the MSVC cl libraries (i.e._getcwd()and_chdir()fromdirect.h). Then, checking what macros are defined allows us to determine what compiler is being used, meaning we can conditionally#definealiases when using MSVCcl.For more info on what macros are defined and for which toolchains, see the table outlined here.