Skip to content

Commit

Permalink
[native] Hacky test for __GLIBC__ to fix compile error on Alpine.
Browse files Browse the repository at this point in the history
This appears to work; I tested it inside the Alpine chroot.
  • Loading branch information
Andy Chu committed Oct 5, 2018
1 parent 889fd29 commit 40d33f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion native/libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,15 @@ func_fnmatch(PyObject *self, PyObject *args) {
return NULL;
}

#ifdef _GNU_SOURCE
// NOTE: Testing for __GLIBC__ is the version detection anti-pattern. We
// should really use feature detection in our configure script. But I plan
// to get rid of the dependency on FNM_EXTMATCH because it doesn't work on
// musl libc (or OS X). Instead we should compile extended globs to extended
// regex syntax.
#ifdef __GLIBC__
int flags = FNM_EXTMATCH;
#else
debug("Warning: FNM_EXTMATCH is not defined");
int flags = 0;
#endif

Expand Down

0 comments on commit 40d33f5

Please sign in to comment.