Define PATH_MAX and MAXPATHLEN for GNU/Hurd compatibility#5046
Merged
ctrlcctrlv merged 2 commits intofontforge:masterfrom Jun 17, 2022
Merged
Conversation
Special thanks to @henrich, @ucko and @kilobyte for reporting the issue and offering suggestions on a fix. See also https://bugs.debian.org/877795 Fixes fontforge#3119
0868190 to
1a6aa06
Compare
ctrlcctrlv
approved these changes
Jun 17, 2022
Member
ctrlcctrlv
left a comment
There was a problem hiding this comment.
This is no problem; although obviously Hurd users won't be getting much benefit from the relaxed limit if all software does this.
I added a comment in cf80140 because I'd be confused by the intended meaning of __GNU__, and assume others would be as it's an uncommon macro.
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.
On GNU Hurd systems (such as Debian GNU/Hurd), Fontforge failed to build from source (FTBFS) because of
MAXPATHLENandPATH_MAXbeing undefined on Hurd, e.g.Special thanks to fellow Debian Developers @henrich, @ucko and @kilobyte for reporting the issue and offering suggestions on a fix back in 2017; see #3119 and https://bugs.debian.org/877795.
Hurd's philosophy of using dynamic memory allocation for these variables aside (thanks to @jtanx for the reference), defining
PATH_MAXandMAXPATHLENas4096for GNU Hurd (distinguished by its unique__GNU__definition) is an easy and non-intrusive solution that would make Fontforge truly universal, as can be seen in the Fontforge build for all 23 architectures that Debian builds for at https://buildd.debian.org/status/package.php?p=fontforge.This patch has been tested to build successfully on Hurd (and all architectures) with the Debian release of fontforge (1:20201107~dfsg-4) on 2021-01-15.
Fixes #3119
Type of change